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 2021/02/23 14:18:02 UTC

[GitHub] [airflow] yohei1126 opened a new pull request #14388: Pass region name to superclass of AWSGlueJobHook

yohei1126 opened a new pull request #14388:
URL: https://github.com/apache/airflow/pull/14388


   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes #14217 
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   Fix #14217 
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   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).
   


----------------------------------------------------------------
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] jhtimmins commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   This fix works, but now you're setting `self.region_name` in both the child and the parent. Probably best to remove `self.region_name = region_name` from the child.
   
   Could you also add a test for this? Just a simple test in https://github.com/apache/airflow/blob/master/tests/providers/amazon/aws/hooks/test_glue.py that instantiates the class and makes sure that `glue.region_name == <expected_value>` should be enough.


----------------------------------------------------------------
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] RosterIn commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   @yohei1126 The failures are:
   ```
   ************* Module tests.providers.amazon.aws.hooks.test_glue
   tests/providers/amazon/aws/hooks/test_glue.py:101:44: E1101: Instance of 'TestGlueJobHook' has no 'some_aws_regions' member; maybe 'some_aws_region'? (no-member)
   ```
   
   and
   
   ```
   _________________ TestGlueJobHook.test_get_or_create_glue_job __________________
     
     self = <tests.providers.amazon.aws.hooks.test_glue.TestGlueJobHook testMethod=test_get_or_create_glue_job>
     mock_get_conn = <MagicMock name='get_conn' id='140119788712848'>
     mock_get_iam_execution_role = <MagicMock name='get_iam_execution_role' id='140119784978248'>
     
         @mock.patch.object(AwsGlueJobHook, "get_iam_execution_role")
         @mock.patch.object(AwsGlueJobHook, "get_conn")
         def test_get_or_create_glue_job(self, mock_get_conn, mock_get_iam_execution_role):
             mock_get_iam_execution_role.return_value = mock.MagicMock(Role={'RoleName': 'my_test_role'})
             some_script = "s3:/glue-examples/glue-scripts/sample_aws_glue_job.py"
             some_s3_bucket = "my-includes"
         
             mock_glue_job = mock_get_conn.return_value.get_job()['Job']['Name']
             glue_job = AwsGlueJobHook(
                 job_name='aws_test_glue_job',
                 desc='This is test case job from Airflow',
                 script_location=some_script,
                 iam_role_name='my_test_role',
                 s3_bucket=some_s3_bucket,
                 region_name=self.some_aws_region,
             ).get_or_create_glue_job()
             assert glue_job == mock_glue_job
     >       assert glue_job.region_name == self.some_aws_region
     E       AssertionError: assert <MagicMock name='get_conn().get_job().__getitem__().__getitem__().region_name' id='140120564084920'> == 'us-west-2'
     E        +  where <MagicMock name='get_conn().get_job().__getitem__().__getitem__().region_name' id='140120564084920'> = <MagicMock name='get_conn().get_job().__getitem__().__getitem__()' id='140120563852120'>.region_name
     E        +  and   'us-west-2' = <tests.providers.amazon.aws.hooks.test_glue.TestGlueJobHook testMethod=test_get_or_create_glue_job>.some_aws_region
     
     tests/providers/amazon/aws/hooks/test_glue.py:75: AssertionError
   ```
   


-- 
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] yohei1126 commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   There are some errors. 
   
   https://github.com/apache/airflow/runs/1970983265
   https://github.com/apache/airflow/runs/1970983080
   
   ```
   Requirement already satisfied: zipp>=0.5 in /home/runner/.local/lib/python3.6/site-packages (from importlib-metadata->pre-commit) (3.4.0)
   ./scripts/ci/static_checks/run_static_checks.sh: /home/runner/.local/bin/pre-commit: /opt/hostedtoolcache/Python/3.6.12/x64/bin/python: bad interpreter: No such file or directory
   ```
   
   


----------------------------------------------------------------
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] github-actions[bot] commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/596678731) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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] github-actions[bot] commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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






-- 
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] yohei1126 commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   @jhtimmins do you know why this failed?


----------------------------------------------------------------
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] github-actions[bot] commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/632753975) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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] eladkal closed pull request #14388: Pass region name to superclass of AWSGlueJobHook

Posted by GitBox <gi...@apache.org>.
eladkal closed pull request #14388:
URL: https://github.com/apache/airflow/pull/14388


   


-- 
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] eladkal commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   Thanks @yohei1126 
   The issue was fixed in https://github.com/apache/airflow/pull/14251


-- 
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] github-actions[bot] commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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






-- 
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] github-actions[bot] commented on pull request #14388: Pass region name to superclass of AWSGlueJobHook

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/705391950) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


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