Taragolis commented on code in PR #32883:
URL: https://github.com/apache/airflow/pull/32883#discussion_r1299979575


##########
airflow/datasets/manager.py:
##########
@@ -52,7 +52,7 @@ def register_dataset_change(
         For local datasets, look them up, record the dataset event, queue 
dagruns, and broadcast
         the dataset event
         """
-        dataset_model = session.query(DatasetModel).filter(DatasetModel.uri == 
dataset.uri).one_or_none()
+        dataset_model = 
session.scalar(select(DatasetModel).where(DatasetModel.uri == dataset.uri))

Review Comment:
   I guess it failed because suggested changes also required to change in 
mocking object
   
   
https://github.com/apache/airflow/blob/eacdeb4ed967313ba49721944c95a3721b5d7afb/tests/datasets/test_manager.py#L57
 
   
   ```python
   mock_session.execute.return_value.scalar_one_or_none.return_value = None
   ```
   
   In this case locally `TestDatasetManager` executed successfully
   
![image](https://github.com/apache/airflow/assets/3998685/f7de0e7d-ba17-4359-a816-f39c09326078)
   



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

Reply via email to