Skip to content

Commit 534dce8

Browse files
Fix Ruff rule A002
1 parent ecf3409 commit 534dce8

File tree

14 files changed

+23
-23
lines changed

14 files changed

+23
-23
lines changed

tfx/dsl/compiler/node_inputs_compiler_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DummyArtifact(types.Artifact):
4747

4848
class DummyNode(base_node.BaseNode):
4949

50-
def __init__(self, id: str, inputs=None, exec_properties=None): # pylint: disable=redefined-builtin
50+
def __init__(self, id: str, inputs=None, exec_properties=None): # noqa: A002
5151
super().__init__()
5252
self.with_id(id)
5353
self._inputs = inputs or {}

tfx/dsl/components/base/base_component_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _BasicComponent(base_component.BaseComponent):
6161
def __init__(self,
6262
spec: types.ComponentSpec = None,
6363
folds: int = None,
64-
input: types.Channel = None): # pylint: disable=redefined-builtin
64+
input: types.Channel = None): # noqa: A002
6565
if not spec:
6666
output = types.Channel(type=_OutputArtifact)
6767
spec = _BasicComponentSpec(folds=folds, input=input, output=output)

tfx/dsl/components/base/base_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ def component_id(self) -> str:
126126

127127
@id.setter
128128
@doc_controls.do_not_doc_in_subclasses
129-
def id(self, id: str) -> None: # pylint: disable=redefined-builtin
129+
def id(self, id: str) -> None: # noqa: A002
130130
self._id = id
131131

132132
# TODO(kmonte): Update this to Self once we're on 3.11 everywhere
133133
@doc_controls.do_not_doc_in_subclasses
134-
def with_id(self, id: str) -> typing_extensions.Self: # pylint: disable=redefined-builtin
134+
def with_id(self, id: str) -> typing_extensions.Self: # noqa: A002
135135
self._id = id
136136
return self
137137

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( # pylint: disable=redefined-builtin
747+
def slice( # noqa: A002
748748
channel: channel_types.BaseChannel,
749749
/,
750750
start: Optional[int] = None,

tfx/dsl/input_resolution/ops/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class DummyArtifact(types.Artifact):
5151
'version': tfx_artifact.Property(type=tfx_artifact.PropertyType.INT),
5252
}
5353

54-
# pylint: disable=redefined-builtin
54+
# noqa: A002
5555
def __init__(
5656
self,
5757
id: Optional[str] = None,
@@ -149,7 +149,7 @@ class FakeComponent(base_component.BaseComponent):
149149

150150
DRIVER_CLASS = base_driver.BaseDriver
151151

152-
def __init__(self, id: str, inputs=None, exec_properties=None): # pylint: disable=redefined-builtin
152+
def __init__(self, id: str, inputs=None, exec_properties=None): # noqa: A002
153153
super().__init__(spec=FakeSpec())
154154
self.with_id(id)
155155

tfx/dsl/input_resolution/resolver_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def my_resolver_stem(input_dict):
228228

229229
def __init__(
230230
self, *,
231-
type: Type[_T], # pylint: disable=redefined-builtin
231+
type: Type[_T], # noqa: A002
232232
default: Union[_T, _Empty] = _EMPTY):
233233
self._type = type
234234
self._required = default is _EMPTY

tfx/dsl/io/fileio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
from tfx.dsl.io.filesystem import PathType
2121

2222
# Import modules that may provide filesystem plugins.
23-
import tfx.dsl.io.plugins.tensorflow_gfile # pylint: disable=unused-import, g-import-not-at-top
24-
import tfx.dsl.io.plugins.local # pylint: disable=unused-import, g-import-not-at-top
23+
import tfx.dsl.io.plugins.tensorflow_gfile # noqa: F401, E402
24+
import tfx.dsl.io.plugins.local # noqa: F401, E402
2525

2626

2727
# Expose `NotFoundError` as `fileio.NotFoundError`.
@@ -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'): # pylint: disable=redefined-builtin
36+
def open(path: PathType, mode: str = 'r'): # noqa: A002
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: # pylint: disable=redefined-builtin
26+
def input(key: str) -> ArtifactPlaceholder: # noqa: A002
2727
"""Returns a Placeholder that represents an input artifact.
2828
2929
Args:

tfx/orchestration/pipeline_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class _FakeComponent(base_component.BaseComponent):
8585

8686
def __init__(
8787
self,
88-
type: Type[types.Artifact], # pylint: disable=redefined-builtin
88+
type: Type[types.Artifact], # noqa: A002
8989
spec_kwargs: Dict[str, Any]):
9090
spec = _FakeComponentSpec(output=types.Channel(type=type), **spec_kwargs)
9191
super().__init__(spec=spec)
@@ -98,7 +98,7 @@ class _FakeBeamComponent(base_beam_component.BaseBeamComponent):
9898

9999
def __init__(
100100
self,
101-
type: Type[types.Artifact], # pylint: disable=redefined-builtin
101+
type: Type[types.Artifact], # noqa: A002
102102
spec_kwargs: Dict[str, Any]):
103103
spec = _FakeComponentSpec(output=types.Channel(type=type), **spec_kwargs)
104104
super().__init__(spec=spec)

tfx/types/artifact_property.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Property:
4949
PropertyType.BOOLEAN: metadata_store_pb2.BOOLEAN,
5050
}
5151

52-
def __init__(self, type): # pylint: disable=redefined-builtin
52+
def __init__(self, type): # noqa: A002
5353
if type not in Property._ALLOWED_MLMD_TYPES:
5454
raise ValueError('Property type must be one of %s.' %
5555
list(Property._ALLOWED_MLMD_TYPES.keys()))

0 commit comments

Comments
 (0)