-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ingest): fix lingering demo-data source issues
- renames dummy-data -> demo-data - makes the config empty
- Loading branch information
Showing
5 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
metadata-ingestion/docs/sources/demo-data/demo-data_recipe.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source: | ||
type: demo-data | ||
config: {} |
6 changes: 0 additions & 6 deletions
6
metadata-ingestion/docs/sources/dummy-data/dummy-data_recipe.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
metadata-ingestion/src/datahub/ingestion/source/demo_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from datahub.configuration.common import ConfigModel | ||
from datahub.ingestion.api.common import PipelineContext | ||
from datahub.ingestion.api.decorators import ( | ||
SupportStatus, | ||
config_class, | ||
platform_name, | ||
support_status, | ||
) | ||
from datahub.ingestion.source.file import FileSourceConfig, GenericFileSource | ||
from datahub.utilities.sample_data import download_sample_data | ||
|
||
|
||
class DemoDataConfig(ConfigModel): | ||
# The demo data source does not accept any configuration. | ||
pass | ||
|
||
|
||
@platform_name("Demo Data") | ||
@config_class(ConfigModel) | ||
@support_status(SupportStatus.UNKNOWN) | ||
class DemoDataSource(GenericFileSource): | ||
""" | ||
This source loads sample data into DataHub. It is intended for demo and testing purposes only. | ||
""" | ||
|
||
def __init__(self, ctx: PipelineContext, config: DemoDataConfig): | ||
file_config = FileSourceConfig(filename=download_sample_data()) | ||
super().__init__(ctx, file_config) | ||
|
||
@classmethod | ||
def create(cls, config_dict, ctx): | ||
config = DemoDataConfig.parse_obj(config_dict or {}) | ||
return cls(ctx, config) |
29 changes: 0 additions & 29 deletions
29
metadata-ingestion/src/datahub/ingestion/source/dummy_source.py
This file was deleted.
Oops, something went wrong.