GithubHelp home page GithubHelp logo

Comments (2)

anirbansaha96 avatar anirbansaha96 commented on September 19, 2024

I changed the content of the python file to:

# from airflow import DAG
# import dagfactory
import os

CUR_DIR = os.path.abspath(os.path.dirname(__file__))
print(CUR_DIR)

# dag_factory = dagfactory.DagFactory(f"{CUR_DIR}/configs/config.yaml")

# dag_factory.clean_dags(globals())
# dag_factory.generate_dags(globals())


# Temporary to check if loading config works with same path.
with open(f"{CUR_DIR}/configs/config.yaml", "r") as stream:
    try:
        import yaml
        configYaml = yaml.safe_load(stream)
        print(configYaml)
    except yaml.YAMLError as exc:
        print(exc)

And executed the file from the Docker shell and got the desired output:

/opt/airflow/dags
{'example_dag1': {'default_args': {'owner': 'example_owner', 'start_date': datetime.date(2018, 1, 1), 'end_date': datetime.date(2018, 1, 5), 'retries': 1, 'retry_delay_sec': 300}, 'schedule_interval': '0 3 * * *', 'concurrency': 1, 'max_active_runs': 1, 'dagrun_timeout_sec': 60, 'default_view': 'tree', 'orientation': 'LR', 'description': 'this is an example dag!', 'tasks': {'task_1': {'operator': 'airflow.operators.bash_operator.BashOperator', 'bash_command': 'echo 1'}, 'task_2': {'operator': 'airflow.operators.bash_operator.BashOperator', 'bash_command': 'echo 2', 'dependencies': ['task_1']}, 'task_3': {'operator': 'airflow.operators.bash_operator.BashOperator', 'bash_command': 'echo 3', 'dependencies': ['task_1']}}}}

from dag-factory.

nitin1677 avatar nitin1677 commented on September 19, 2024

we are also facing the same issue, did you get any workaround to get this resolved.

from dag-factory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.