Skip to content

Commit

Permalink
fix(ingest): continue validation of s3 path_specs even if platform is…
Browse files Browse the repository at this point in the history
… set (#5951)
  • Loading branch information
mayurinehate authored Sep 16, 2022
1 parent eca73c0 commit a14617b
Show file tree
Hide file tree
Showing 3 changed files with 1,660 additions and 7 deletions.
8 changes: 2 additions & 6 deletions metadata-ingestion/src/datahub/ingestion/source/s3/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ class DataLakeSourceConfig(PlatformSourceConfigBase, EnvBasedSourceConfigBase):

@pydantic.root_validator(pre=False)
def validate_platform(cls, values: Dict) -> Dict:
value = values.get("platform")
if value is not None and value != "":
return values

if not values.get("path_specs") and not values.get("path_spec"):
raise ValueError("Either path_specs or path_spec needs to be specified")

Expand All @@ -96,8 +92,8 @@ def validate_platform(cls, values: Dict) -> Dict:

platform = "file"

if values.get("platform", "") != "":
if values["platform"] != platform:
if values.get("platform", ""):
if platform == "s3" and values["platform"] != platform:
raise ValueError("all path_spec should belong to the same platform")
else:
values["platform"] = platform
Expand Down
Loading

0 comments on commit a14617b

Please sign in to comment.