Last active
May 12, 2021 23:06
-
-
Save MatrixManAtYrService/389f0fe345c8749587600ed6ba8adc24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def print_one(it): | |
print(it) | |
@task | |
def print_another(it): | |
print(it) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def return_two() -> Tuple[str, int] | |
return "nine", 6 | |
@dag | |
def the_dag(): | |
# a, b == "nine", 6 | |
a, b = return_two() | |
# dag structure is inferred | |
print_one(a) | |
print_another(b) | |
d = the_dag() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def return_two() -> Dict[str, str]: | |
return {"one": "nine", "another": 6} | |
@dag | |
def the_dag(): | |
# a is a dict | |
a = return_two() | |
# outputs must be referenced stringly | |
b = print_one("{{ ti.xcom_pull(key='one') }}") | |
c = print_another("{{ ti.xcom_pull(key='another') }}") | |
# dag structure is explicit | |
a >> b | |
a >> c | |
d = the_dag() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment