Comments (4)
This was inspired by seeing the programmatic looping here in the digdag-analytics poc: https://github.com/treasure-data/digdag-analytics/blob/master/se_poc_emails/tasks/poc_workflow.rb#L15
It seems desirable to be able to use digdag to perform these queries and leverage the digdag parallelism, retry and dependency tracking etc facilities instead.
from digdag.
- Use YAML reference (
&
and*
). This works now as you mentioned. - Introduce a new syntax like
key: @foo
,key: @{foo}
,key: @${foo}
,key: $@foo
,key=: foo
,key: !param foo
etc. - Preserve type of
foo
if a value is${foo}
without any characters around it.
If foo is an integer,prefix_${foo}
is string,${foo}_suffix
is string, but${foo}
is integer.
I think this is problematic when users want to convert integer to string. In YAML syntax, you can use"${foo}"
but there're no ways to distinguish it from${foo}
. So, users need to use${foo.toString()}
. I think this is not intuitive. - Parse value as a JSON string if an operator gets it with array or map type.
If operator is written in Java, it usesint foo = conf.get("foo", int.class)
orList<String> foo = conf.getList("foo", String.class)
API to get a config value. Thisget
orgetList
methods have a chance to convert value type.
Currently,conf.getList("foo", String.class)
fails if actual value offoo
is not a list. But we can change the behavior so that it tries to parse the string as JSON if the actual value is string.
This works because${foo}
convertsfoo
to a JSON string iffoo
is a list or map.
But this doesn't work if operator is Ruby or Python (dynamically-typed).params.get("foo")
is string even if the operator expects list. - Similar to 3, but use string by default. But
raw(...)
to preserve type. So,${foo}
is string, but${raw(foo)}
is list.prefix_${raw(foo)}
is string, though.
In a very old version, syntax was key=: foo
(so, idea 2).
from digdag.
I like the key: @foos
syntax but @
is reserved and cannot be used to start a token in yaml =/
http://yaml.org/spec/current.html#c-directive
On the other hand, less ways to parameterize things means less surprise and mistakes for our users, so allowing key: ${foos}
(idea 4) might be more desirable.
from digdag.
It would also be useful to be able to do things like:
run: +main
+main:
for_each>:
foo:
- bar: a
baz: b
- bar: c
baz: d
_do:
sh>: "echo ${foo.bar}: ${foo.baz}"
Where the tasks executed for the above would be:
echo a b
echo c d
Currently the above produces:
error:
* +main:
io.digdag.core.repository.ModelValidationException: Validating workflow task failed
name can't contain character "+for-foo={bar=a, baz=b}"
from digdag.
Related Issues (20)
- Digdag CLI to schedule workflow session for a future date/time HOT 1
- node-sass is deprecated HOT 6
- InvalidParameterException occurred only when executing sh operator on ECSCommandExecutor. HOT 9
- ECS Command Executor fails if task continues for 10 minutes or more. HOT 1
- How do I point to the parent path? HOT 1
- [feature-request] Oracle operator HOT 1
- Unable to kill node.js task HOT 3
- How to create a global config for multiple projects in the workspace? HOT 2
- Unable to exit as success status when using sys.exit(0) from py:> operator HOT 2
- broken dependency in digdag-client
- Please add route /workflows/{workflow_id}/edit
- [Regression] Commit breaks --enable-swagger HOT 3
- Concurrent update in table "QUEUED_TASK_LOCKS": another transaction has updated or deleted the same row [90131-192] HOT 5
- Please release v0.10.5 HOT 2
- Swagger is broken in v0.10.5 and v0.10.5.1 HOT 2
- Docker build environment fails to build HOT 1
- How to exit or continue while using if or for_each or range or loop in digdag?
- How to add two conditions in the if statement in digdag? HOT 2
- Workflow task is showing running status
- Error with http call HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digdag.