-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new Auto Classification Workflow #18610
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
26a9425
skeleton
pmbrull 402b64e
separate sampler
pmbrull 9ad37c4
separate sampler
pmbrull 16c2a58
separate sampler
pmbrull 0a79f76
Merge remote-tracking branch 'upstream/main' into separate-workflow
pmbrull f02043d
merge
pmbrull 85ab4f5
workflow
pmbrull bd98a7b
schemas
pmbrull f5519b4
prep
pmbrull ebbfc00
Merge remote-tracking branch 'upstream/main' into separate-workflow
pmbrull bd619f1
fix
pmbrull da82e91
fix
pmbrull c8956cb
copy db
pmbrull 3a56ec8
fix tests and remove unused method
pmbrull 76db1b1
fix tests
pmbrull 9dd20ee
Merge remote-tracking branch 'upstream/main' into separate-workflow
pmbrull f6d6e83
fix tests
pmbrull 56f6643
linting and tests
pmbrull 48b8b64
rename workflow
pmbrull d58e916
rename
pmbrull 11f8156
prepare ingestion pipeline
pmbrull fc01ac6
migrate profiler pipeline
pmbrull 460d1d7
Merge branch 'main' into separate-workflow
pmbrull 7117f1d
fix
pmbrull ed193e1
Merge remote-tracking branch 'origin/separate-workflow' into separate…
pmbrull dfcbb78
fix
pmbrull 4091660
compat
pmbrull 1c5309f
compat
pmbrull 79958b8
fix tests and comments
pmbrull 621efef
Merge remote-tracking branch 'upstream/main' into separate-workflow
pmbrull 9c0f78b
tests
pmbrull 669d119
Merge remote-tracking branch 'upstream/main' into separate-workflow
pmbrull d5a5bf4
tests
pmbrull d4042a1
SampleData
pmbrull 1983af6
SampleData
pmbrull 74ae007
clean test
pmbrull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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,52 @@ | ||
# Copyright 2021 Collate | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
Sampler utility for the metadata CLI | ||
""" | ||
import sys | ||
import traceback | ||
from pathlib import Path | ||
|
||
from metadata.config.common import load_config_file | ||
from metadata.generated.schema.entity.services.ingestionPipelines.ingestionPipeline import ( | ||
PipelineType, | ||
) | ||
from metadata.utils.logger import cli_logger, redacted_config | ||
from metadata.workflow.classification import AutoClassificationWorkflow | ||
from metadata.workflow.workflow_init_error_handler import WorkflowInitErrorHandler | ||
|
||
logger = cli_logger() | ||
|
||
|
||
def run_classification(config_path: Path) -> None: | ||
""" | ||
Run the sampler workflow from a config path | ||
to a JSON or YAML file | ||
:param config_path: Path to load JSON config | ||
""" | ||
|
||
config_dict = None | ||
try: | ||
config_dict = load_config_file(config_path) | ||
logger.debug("Using workflow config:\n%s", redacted_config(config_dict)) | ||
workflow = AutoClassificationWorkflow.create(config_dict) | ||
except Exception as exc: | ||
logger.debug(traceback.format_exc()) | ||
WorkflowInitErrorHandler.print_init_error( | ||
exc, config_dict, PipelineType.metadata | ||
) | ||
sys.exit(1) | ||
|
||
workflow.execute() | ||
workflow.stop() | ||
workflow.print_status() | ||
workflow.raise_from_status() |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we kept the logic to pass the Metadata object when creating orm object. We need it to prevent naming conflict when creating the orm object if I well remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ORM table is now an input argument https://github.com/open-metadata/OpenMetadata/pull/18610/files#diff-e8a8a48b444e6246572ad762618b52eed69b4b7a75ffba896cf8314f56c15990R132
Before we sent the
sqa_metadata
object and let the interfaces (profiler/test suite) create the ORM. Now, since the sampler needs the ORM table too, we create it at thesource
and pass it as an arg to the 3 interfacesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently for the profiler each database should have its own instance of the Metadata. So that if you are profiling service
abc
with 2 databases where each database has a table nameFOO
then we won't have conflict. #6009.