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 2020/04/27 13:43:26 UTC

[GitHub] [airflow] vshshjn7 opened a new pull request #8587: Patch Pool.DEFAULT_POOL_NAME in BaseOperator

vshshjn7 opened a new pull request #8587:
URL: https://github.com/apache/airflow/pull/8587


   Currently, it is not possible to patch Pool in BaseOperator as the signature sets the default value of Pool as Pool.DEFAULT_POOL_NAME.
   Because of this, test case which uses SubDagOperator breaks because of the _validate_pool in subdag_operator.py (L96). Here it tries to query DB to resolve pool conflict, and fails with the following error:
   ```
                            def do_execute(self, cursor, statement, parameters, context=None):
                        >       cursor.execute(statement, parameters)
                        E       sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: slot_pool
                        E       [SQL: SELECT slot_pool.id AS slot_pool_id, slot_pool.pool AS slot_pool_pool, slot_pool.slots AS slot_pool_slots, slot_pool.description AS slot_pool_description 
                        E       FROM slot_pool 
                        E       WHERE slot_pool.slots = ? AND slot_pool.pool = ?
                        E        LIMIT ? OFFSET ?]
                        E       [parameters: (1, 'default_pool', 1, 0)]
                        E       (Background on this error at: http://sqlalche.me/e/e3q8)
                        
                        .pants.d/requirements/requirements/CPython-3.6.4/4f9ce35f4559abaae23151dad89c7103961dd1eb/.deps/SQLAlchemy-1.3.8-cp36-cp36m-macosx_10_13_x86_64.whl/sqlalchemy/engine/default.py:552: OperationalError
   
   ```
   My assumption here is that DB doesn't exist for running test cases, hence I am patching `Pool.DEFAULT_POOL_NAME` to `None`, so that it won't enter the _validate_pool of subdag_operator.
   
   Here is a gist link of what I am trying to do:
   https://gist.github.com/vshshjn7/cdf869b9c9ef5a73c4ffbf73b498c71d
   
   
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [yes] Description above provides context of the change
   - [not req] Unit tests coverage for changes (not needed for documentation changes)
   - [yes] Target Github ISSUE in description if exists
   - [yes] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [yes] Relevant documentation is updated including usage instructions.
   - [ ] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #8587: Patch Pool.DEFAULT_POOL_NAME in BaseOperator

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #8587:
URL: https://github.com/apache/airflow/pull/8587#issuecomment-619994970


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://apache-airflow-slack.herokuapp.com/
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] msumit commented on pull request #8587: Patch Pool.DEFAULT_POOL_NAME in BaseOperator

Posted by GitBox <gi...@apache.org>.
msumit commented on pull request #8587:
URL: https://github.com/apache/airflow/pull/8587#issuecomment-620595661


   @vshshjn7 one test case is failing due to change. Also, you need to resolve the conflict. 


----------------------------------------------------------------
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.

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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #8587: Patch Pool.DEFAULT_POOL_NAME in BaseOperator

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #8587:
URL: https://github.com/apache/airflow/pull/8587#issuecomment-625708740


   Awesome work, congrats on your first merged pull request!
   


----------------------------------------------------------------
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.

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