Skip to content

Commit d25cd14

Browse files
Fix Ruff rule A
1 parent 534dce8 commit d25cd14

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

tfx/dsl/input_resolution/canned_resolver_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def pick(channel: channel_types.BaseChannel, i: int, /):
744744
return _slice(channel, start=i, stop=(i + 1) or None, min_count=1)
745745

746746

747-
def slice( # noqa: A002
747+
def slice( # noqa: A002, A001
748748
channel: channel_types.BaseChannel,
749749
/,
750750
start: Optional[int] = None,

tfx/dsl/input_resolution/ops/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DummyArtifact(types.Artifact):
5454
# noqa: A002
5555
def __init__(
5656
self,
57-
id: Optional[str] = None,
57+
id: Optional[str] = None, # noqa: A001, A002
5858
uri: Optional[str] = None,
5959
create_time_since_epoch: Optional[int] = None,
6060
):

tfx/dsl/io/fileio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _get_filesystem(path) -> Type[filesystem.Filesystem]:
3333
.get_filesystem_for_path(path))
3434

3535

36-
def open(path: PathType, mode: str = 'r'): # noqa: A002
36+
def open(path: PathType, mode: str = 'r'): # noqa: A002, A001
3737
"""Open a file at the given path."""
3838
return _get_filesystem(path).open(path, mode=mode)
3939

tfx/dsl/placeholder/artifact_placeholder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_types = placeholder_base.types
2424

2525

26-
def input(key: str) -> ArtifactPlaceholder: # noqa: A002
26+
def input(key: str) -> ArtifactPlaceholder: # noqa: A002, A001
2727
"""Returns a Placeholder that represents an input artifact.
2828
2929
Args:

tfx/orchestration/portable/input_resolution/mlmd_resolver/metadata_resolver.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def get_downstream_artifacts_by_artifact_ids(
305305
if store is None:
306306
raise ValueError('MetadataStore provided to MetadataResolver is None.')
307307

308-
artifact_ids_str = ','.join(str(id) for id in artifact_ids)
308+
artifact_ids_str = ','.join(str(id) for id in artifact_ids) # noqa: A001
309309
# If `max_num_hops` is set to 0, we don't need the graph traversal.
310310
if max_num_hops == 0:
311311
if not filter_query:
@@ -370,7 +370,7 @@ def get_downstream_artifacts_by_artifact_ids(
370370
candidate_artifact_ids.update(
371371
visited_ids[metadata_resolver_utils.NodeType.ARTIFACT]
372372
)
373-
artifact_ids_str = ','.join(str(id) for id in candidate_artifact_ids)
373+
artifact_ids_str = ','.join(str(id) for id in candidate_artifact_ids) # noqa: A001
374374
# Send a call to metadata_store to get filtered downstream artifacts.
375375
artifacts = store.get_artifacts(
376376
list_options=mlmd.ListOptions(
@@ -387,7 +387,7 @@ def get_downstream_artifacts_by_artifact_ids(
387387
artifact_id_to_artifact[id],
388388
artifact_type_by_id[artifact_id_to_artifact[id].type_id],
389389
)
390-
for id in visited_ids[metadata_resolver_utils.NodeType.ARTIFACT]
390+
for id in visited_ids[metadata_resolver_utils.NodeType.ARTIFACT] # noqa: A001
391391
if id in artifact_id_to_artifact
392392
]
393393
if downstream_artifacts:
@@ -594,7 +594,7 @@ def get_upstream_artifacts_by_artifact_ids(
594594
if store is None:
595595
raise ValueError('MetadataStore provided to MetadataResolver is None.')
596596

597-
artifact_ids_str = ','.join(str(id) for id in artifact_ids)
597+
artifact_ids_str = ','.join(str(id) for id in artifact_ids) # noqa: A001
598598
# If `max_num_hops` is set to 0, we don't need the graph traversal.
599599
if max_num_hops == 0:
600600
if not filter_query:
@@ -662,7 +662,7 @@ def get_upstream_artifacts_by_artifact_ids(
662662
candidate_artifact_ids.update(
663663
visited_ids[metadata_resolver_utils.NodeType.ARTIFACT]
664664
)
665-
artifact_ids_str = ','.join(str(id) for id in candidate_artifact_ids)
665+
artifact_ids_str = ','.join(str(id) for id in candidate_artifact_ids) # noqa: A001
666666
# Send a call to metadata_store to get filtered upstream artifacts.
667667
artifacts = store.get_artifacts(
668668
list_options=mlmd.ListOptions(
@@ -679,7 +679,7 @@ def get_upstream_artifacts_by_artifact_ids(
679679
artifact_id_to_artifact[id],
680680
artifact_type_by_id[artifact_id_to_artifact[id].type_id],
681681
)
682-
for id in visited_ids[metadata_resolver_utils.NodeType.ARTIFACT]
682+
for id in visited_ids[metadata_resolver_utils.NodeType.ARTIFACT] # noqa: A001
683683
if id in artifact_id_to_artifact
684684
]
685685
if upstream_artifacts:

0 commit comments

Comments
 (0)