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

Fix number param html type in trigger template #31980

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

hussein-awala
Copy link
Member

related: #31930
related: #31946

It seems that when I changed the valuetype to decimal, the value was passed to the API a string which raise a validation exception in the dag run. Changing just the type to decimal is sufficient to fix the initial issue, for ex:

DAG(
    dag_id="params",
    schedule_interval=None,
    start_date=days_ago(2),
    params={
        "param_1": Param(default=None, type=["number", "null"]),
        "param_2": Param(default='x', type='string')
    },
)

image

image


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

…hange only type value

Signed-off-by: Hussein Awala <hussein@awala.fr>
@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Jun 17, 2023
{%- if "integer" in form_details.schema.type %} valuetype="number" {% elif "number" in form_details.schema.type %} valuetype="decimal" {%- endif %}
{%- if "integer" in form_details.schema.type or "number" in form_details.schema.type %} valuetype="number"{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just to make sure, this PR reverts this line from #31946 and the aggregated change is only line 120, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because we need just to change type attribute

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
@hussein-awala hussein-awala merged commit 2327718 into apache:main Jun 19, 2023
42 checks passed
@ephraimbuddy ephraimbuddy added this to the Airlfow 2.6.3 milestone Jul 6, 2023
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jul 6, 2023
ephraimbuddy pushed a commit that referenced this pull request Jul 6, 2023
* Keep valuetype="number" for both param number and integer types and change only type value

Signed-off-by: Hussein Awala <hussein@awala.fr>

* Update airflow/www/templates/airflow/trigger.html

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>

---------

Signed-off-by: Hussein Awala <hussein@awala.fr>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
(cherry picked from commit 2327718)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants