hussein-awala commented on code in PR #40766:
URL: https://github.com/apache/airflow/pull/40766#discussion_r1676936134
##########
tests/sensors/test_time_delta.py:
##########
@@ -57,7 +58,8 @@ def setup_method(self):
@pytest.mark.parametrize(
"data_interval_end, delta, should_deffer",
[
- (REFERENCE_TIME.add(hours=-1), timedelta(hours=1), False),
+ (copy(REFERENCE_TIME).add(hours=-1), timedelta(hours=1), False),
Review Comment:
Why `add()` would change the value of the original variable? It is not
in-place method 🤔
```python
>>> import pendulum
>>> d = pendulum.now()
>>> d
DateTime(2024, 7, 13, 22, 4, 21, 948725, tzinfo=Timezone('Europe/Paris'))
>>> d.add(hours=-1)
DateTime(2024, 7, 13, 21, 4, 21, 948725, tzinfo=Timezone('Europe/Paris'))
>>> d
DateTime(2024, 7, 13, 22, 4, 21, 948725, tzinfo=Timezone('Europe/Paris'))
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]