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/02/23 10:45:43 UTC

[GitHub] [airflow] uranusjr opened a new pull request #21759: Rewrite taskflow-mapping argument validation

uranusjr opened a new pull request #21759:
URL: https://github.com/apache/airflow/pull/21759


   This new check now takes account of ti context variables and block
   mapping/assigning to them. A few tests are added to validate the
   behavior.
   
   <!--
   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: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/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/main/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.

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

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



[GitHub] [airflow] uranusjr commented on pull request #21759: Rewrite taskflow-mapping argument validation

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


   Hmm, this is failing with a seemingly unrelated error:
   
   ```
   _________________ TestTriggererCommand.test_capacity_argument __________________
     
     self = <tests.cli.commands.test_triggerer_command.TestTriggererCommand testMethod=test_capacity_argument>
     mock_scheduler_job = <MagicMock name='TriggererJob' id='140183951380688'>
     
         @pytest.mark.skipif(not PY37, reason="triggerer subcommand only works with Python 3.7+")
         @mock.patch("airflow.cli.commands.triggerer_command.TriggererJob")
         def test_capacity_argument(
             self,
             mock_scheduler_job,
         ):
             """Ensure that the capacity argument is passed correctly"""
             args = self.parser.parse_args(['triggerer', '--capacity=42'])
             triggerer_command.triggerer(args)
     >       mock_scheduler_job.assert_called_once_with(capacity="42")
     
     tests/cli/commands/test_triggerer_command.py:46: 
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     /usr/local/lib/python3.7/unittest/mock.py:889: in assert_called_once_with
         return self.assert_called_with(*args, **kwargs)
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     
     _mock_self = <MagicMock name='TriggererJob' id='140183951380688'>, args = ()
     kwargs = {'capacity': '42'}, expected = ((), {'capacity': '42'})
     _error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f7f1dceb050>
     actual = call(capacity=42), cause = None
     
         def assert_called_with(_mock_self, *args, **kwargs):
             """assert that the mock was called with the specified arguments.
         
             Raises an AssertionError if the args and keyword args passed in are
             different to the last call to the mock."""
             self = _mock_self
             if self.call_args is None:
                 expected = self._format_mock_call_signature(args, kwargs)
                 raise AssertionError('Expected call: %s\nNot called' % (expected,))
         
             def _error_message():
                 msg = self._format_mock_failure_message(args, kwargs)
                 return msg
             expected = self._call_matcher((args, kwargs))
             actual = self._call_matcher(self.call_args)
             if expected != actual:
                 cause = expected if isinstance(expected, Exception) else None
     >           raise AssertionError(_error_message()) from cause
     E           AssertionError: Expected call: TriggererJob(capacity='42')
     E           Actual call: TriggererJob(capacity=42)
     
     /usr/local/lib/python3.7/unittest/mock.py:878: AssertionError
   ```
   
   Investigating.


-- 
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] uranusjr commented on pull request #21759: Rewrite taskflow-mapping argument validation

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


   Looks like #21753 is the cause. Fixing that first.


-- 
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 #21759: Rewrite taskflow-mapping argument validation

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


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, 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] uranusjr edited a comment on pull request #21759: Rewrite taskflow-mapping argument validation

Posted by GitBox <gi...@apache.org>.
uranusjr edited a comment on pull request #21759:
URL: https://github.com/apache/airflow/pull/21759#issuecomment-1049534078


   ~~Looks like #21753 is the cause. Fixing that first.~~ Actually, seems to pass on main? Rebasing.


-- 
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] uranusjr commented on pull request #21759: Rewrite taskflow-mapping argument validation

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


   Provider-building job failed without logs. Hopefully unrelated; can’t see how it could be.


-- 
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] uranusjr merged pull request #21759: Rewrite taskflow-mapping argument validation

Posted by GitBox <gi...@apache.org>.
uranusjr merged pull request #21759:
URL: https://github.com/apache/airflow/pull/21759


   


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