Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ def test_run_grant_dataset_view_access_granting(self, mock_update, mock_get):
)

mock_get.assert_called_once_with(project_id=PROJECT_ID, dataset_id=DATASET_ID)
assert view_access in dataset.access_entries
assert any(
entry.role == view_access.role
and entry.entity_type == view_access.entity_type
and entry.entity_id == view_access.entity_id
for entry in dataset.access_entries
), f"View access entry not found in {dataset.access_entries}"
mock_update.assert_called_once_with(
fields=["access"],
dataset_resource=dataset.to_api_repr(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,14 @@ def _iter_serializable_context_keys(self):
# If we're using system packages, assume both are present
found_airflow = found_pendulum = True
else:
for raw_str in self.requirements:
requirements_iterable = []
if isinstance(self.requirements, str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed the fact that requirements could be other thing than a list. But based on the constructor code, it looks impossible to get a string here:

        elif isinstance(requirements, str):
            self.requirements = [requirements]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

requirements_iterable = self.requirements.splitlines()
else:
for item in self.requirements:
requirements_iterable.extend(item.splitlines())

for raw_str in requirements_iterable:
line = raw_str.strip()
# Skip blank lines and full‐line comments
if not line or line.startswith("#"):
Expand Down
Loading