Skip to content

Commit b5782d4

Browse files
committed
lint
Signed-off-by: Nelson Chen <asd3431090@gmail.com>
1 parent 1bf5826 commit b5782d4

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

flytekit/configuration/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ def auto(cls, config_file: typing.Union[str, ConfigFile] = None) -> LocalConfig:
662662
kwargs = set_if_exists(kwargs, "cache_overwrite", _internal.Local.CACHE_OVERWRITE.read(config_file))
663663
return LocalConfig(**kwargs)
664664

665+
665666
@dataclass(init=True, repr=True, eq=True, frozen=True)
666667
class FieldConfig(object):
667668
"""
@@ -681,6 +682,7 @@ def auto(cls, config_file: typing.Union[str, ConfigFile] = None) -> FieldConfig:
681682
kwargs = set_if_exists(kwargs, "org", _internal.Local.USER_ORG.read(config_file))
682683
return FieldConfig(**kwargs)
683684

685+
684686
@dataclass(init=True, repr=True, eq=True, frozen=True)
685687
class Config(object):
686688
"""
@@ -691,10 +693,13 @@ class Config(object):
691693
2. Some parts are required for Serialization, for example Platform Config is not required
692694
3. Runtime of a task
693695
694-
Args:
695-
entrypoint_settings: EntrypointSettings object for use with Spark tasks. If supplied, this will be
696-
used when serializing Spark tasks, which need to know the path to the flytekit entrypoint.py file,
697-
inside the container.
696+
Attributes:
697+
platform (PlatformConfig): Settings to connect to a Flyte backend.
698+
secrets (SecretsConfig): Configuration for secrets management.
699+
stats (StatsConfig): Configuration for statsd metrics.
700+
data_config (DataConfig): Data storage configuration.
701+
local_sandbox_path (str): Path for local sandbox runs.
702+
field_config (FieldConfig): Project/Domain/Org configuration.
698703
"""
699704

700705
platform: PlatformConfig = PlatformConfig()

flytekit/configuration/internal.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,27 @@ class Local(object):
7575
SECTION = "local"
7676
CACHE_ENABLED = ConfigEntry(LegacyConfigEntry(SECTION, "cache_enabled", bool))
7777
CACHE_OVERWRITE = ConfigEntry(LegacyConfigEntry(SECTION, "cache_overwrite", bool))
78-
USER_PROJECT = ConfigEntry(LegacyConfigEntry(SECTION, "project",),YamlConfigEntry("task.project"))
79-
USER_DOMAIN = ConfigEntry(LegacyConfigEntry(SECTION, "domain",),YamlConfigEntry("task.domain"))
80-
USER_ORG = ConfigEntry(LegacyConfigEntry(SECTION, "org",),YamlConfigEntry("task.org"))
81-
78+
USER_PROJECT = ConfigEntry(
79+
LegacyConfigEntry(
80+
SECTION,
81+
"project",
82+
),
83+
YamlConfigEntry("task.project"),
84+
)
85+
USER_DOMAIN = ConfigEntry(
86+
LegacyConfigEntry(
87+
SECTION,
88+
"domain",
89+
),
90+
YamlConfigEntry("task.domain"),
91+
)
92+
USER_ORG = ConfigEntry(
93+
LegacyConfigEntry(
94+
SECTION,
95+
"org",
96+
),
97+
YamlConfigEntry("task.org"),
98+
)
8299

83100

84101
class Credentials(object):

pydoclint-errors-baseline.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ flytekit/configuration/__init__.py
1313
DOC103: Function `_parse_image_identifier`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [image_identifier: str].
1414
DOC203: Function `_parse_image_identifier` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['typing.Tuple[str, Optional[str], Optional[str]]']; docstring return section types: ['Tuple[str, str, str]']
1515
DOC605: Class `ImageConfig`: Attribute names match, but type hints in these attributes do not match: images (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
16-
DOC601: Class `Config`: Class docstring contains fewer class attributes than actual class attributes. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
17-
DOC603: Class `Config`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [data_config: DataConfig, local_sandbox_path: str, platform: PlatformConfig, secrets: SecretsConfig, stats: StatsConfig]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
1816
DOC603: Class `SerializationSettings`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [git_repo: Optional[str]]. Arguments in the docstring but not in the actual class attributes: [entrypoint_settings: Optional[EntrypointSettings]]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
1917
--------------------
2018
flytekit/configuration/file.py

0 commit comments

Comments
 (0)