You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/25 11:54:28 UTC

[GitHub] [airflow] ephraimbuddy opened a new pull request, #23217: Catch `ParamValidationError` in view when triggering a DAG

ephraimbuddy opened a new pull request, #23217:
URL: https://github.com/apache/airflow/pull/23217

   dag.create_dagrun can raise `ParamValidationError`. We should capture it
   when manually triggering a dag to avoid breaking the UI
   
   Before:
   <details><summary>UI log</summary>
   
   ```log
   
   Something bad has happened.
   
   Airflow is used by many users, and it is very likely that others had similar problems and you can easily find
   a solution to your problem.
   
   Consider following these steps:
   
     * gather the relevant information (detailed logs with errors, reproduction steps, details of your deployment)
   
     * find similar issues using:
        * [GitHub Discussions](https://github.com/apache/airflow/discussions)
        * [GitHub Issues](https://github.com/apache/airflow/issues)
        * [Stack Overflow](https://stackoverflow.com/questions/tagged/airflow)
        * the usual search engine you use on a daily basis
   
     * if you run Airflow on a Managed Service, consider opening an issue using the service support channels
   
     * if you tried and have difficulty with diagnosing and fixing the problem yourself, consider creating a [bug report](https://github.com/apache/airflow/issues/new/choose).
       Make sure however, to include all relevant details and results of your investigation so far.
   
   Python version: 3.7.13
   Airflow version: 2.3.0b1
   Node: c260831d3c16
   -------------------------------------------------------------------------------
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
       response = self.full_dispatch_request()
     File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
       raise value
     File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/opt/airflow/airflow/www/auth.py", line 40, in decorated
       return func(*args, **kwargs)
     File "/opt/airflow/airflow/www/decorators.py", line 80, in wrapper
       return f(*args, **kwargs)
     File "/opt/airflow/airflow/utils/session.py", line 71, in wrapper
       return func(*args, session=session, **kwargs)
     File "/opt/airflow/airflow/www/views.py", line 1946, in trigger
       run_id=run_id,
     File "/opt/airflow/airflow/utils/session.py", line 71, in wrapper
       return func(*args, session=session, **kwargs)
     File "/opt/airflow/airflow/models/dag.py", line 2311, in create_dagrun
       copied_params.update(conf or {})
     File "/opt/airflow/airflow/models/param.py", line 196, in update
       super().update(*args, **kwargs)
     File "/usr/local/lib/python3.7/_collections_abc.py", line 841, in update
       self[key] = other[key]
     File "/opt/airflow/airflow/models/param.py", line 166, in __setitem__
       raise ParamValidationError(f'Invalid input for param {key}: {ve}') from None
   airflow.exceptions.ParamValidationError: Invalid input for param int_param: 50 is greater than the maximum of 20
   
   Failed validating 'maximum' in schema:
       {'maximum': 20, 'minimum': 0, 'type': 'integer'}
   
   On instance:
       50
   ```
   
   </details>
   
   After:
   ![Screenshot (61)](https://user-images.githubusercontent.com/4122866/165083213-790f4251-4abb-4c4f-b00a-37d8ab77d00c.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] github-actions[bot] commented on pull request #23217: Catch `ParamValidationError` in view when triggering a DAG

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #23217:
URL: https://github.com/apache/airflow/pull/23217#issuecomment-1108478850

   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy merged pull request #23217: Catch `ParamValidationError` in view when triggering a DAG

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged PR #23217:
URL: https://github.com/apache/airflow/pull/23217


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org