Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Able to pass arguments to --conf not specified in parameters argument #29018

Closed
1 of 2 tasks
aamster opened this issue Jan 18, 2023 · 4 comments
Closed
1 of 2 tasks

Able to pass arguments to --conf not specified in parameters argument #29018

aamster opened this issue Jan 18, 2023 · 4 comments
Labels
affected_version:2.5 Issues Reported for 2.5 area:core kind:bug This is a clearly a bug Stale Bug Report

Comments

@aamster
Copy link

aamster commented Jan 18, 2023

Apache Airflow version

2.5.0

What happened

Given the following

import datetime

from airflow.models.dag import dag


@dag(
    dag_id="foo",
    schedule=None,
    start_date=datetime.datetime.now()
)
def foo():
    pass


foo()


if __name__ == '__main__':
    foo().test(run_conf={'foo': 1})

It runs fine.

The same is true if params is {'bar': Param(default=None)}

What you think should happen instead

This should result in an exception since foo is not a parameter of the dag. Either the parameters idea needs to be fully implemented or not at all. Currently it is only partially implemented.

How to reproduce

No response

Operating System

mac osx

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@hussein-awala
Copy link
Member

The problem is that there is currently no way to provide params directly, instead we provide the parameters as dag_run.conf which is a free dictionary without any validation. Airflow overrides the params values by using this dictionary when core.dag_run_conf_overrides_params is not disabled.

I was working on a PR to add params argument for the different Airflow APIs (UI, CLI, Python API, and REST API) to provide the values directly with a validation, and I would be happy to finish it.
@potiuk what do you think?

@potiuk
Copy link
Member

potiuk commented Jan 20, 2023

yes.

Copy link

github-actions bot commented Feb 7, 2024

This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.

Copy link

github-actions bot commented Mar 9, 2024

This issue has been closed because it has not received response from the issue author.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:2.5 Issues Reported for 2.5 area:core kind:bug This is a clearly a bug Stale Bug Report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants