uranusjr commented on code in PR #41264:
URL: https://github.com/apache/airflow/pull/41264#discussion_r1705338968
##########
airflow/datasets/__init__.py:
##########
@@ -294,6 +297,9 @@ def as_expression(self) -> Any:
def iter_datasets(self) -> Iterator[tuple[str, Dataset]]:
yield self.uri, self
+ def iter_dataset_aliases(self) -> Iterator[DatasetAlias]:
+ raise StopIteration()
Review Comment:
```suggestion
def iter_dataset_aliases(self) -> Iterator[DatasetAlias]:
return iter(())
```
I think? Otherwise the error is raised too early.
```pycon
>>> def f1():
... raise StopIteration
...
>>> def f2():
... return iter(())
...
>>> for a in f1(): pass # Wrong
...
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
for a in f1(): pass
~~^^
File "<python-input-0>", line 2, in f1
raise StopIteration
StopIteration
>>> for a in f2(): pass # Correct
...
>>>
```
--
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]