Skip to content
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

Remove obsolete read_entry_data method from class ComponentCatalogConnector #3141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 7 additions & 42 deletions elyra/pipeline/catalog_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
from typing import Optional
from urllib.parse import urlparse

from deprecation import deprecated
from jupyter_core.paths import ENV_JUPYTER_PATH
from requests.auth import HTTPBasicAuth
from requests.sessions import Session
from traitlets.config import LoggingConfigurable
from traitlets.traitlets import default
from traitlets.traitlets import Integer

from elyra._version import __version__
from elyra.metadata.metadata import Metadata
from elyra.pipeline.component import Component
from elyra.pipeline.properties import ComponentProperty
Expand Down Expand Up @@ -221,39 +219,6 @@ def get_catalog_entries(self, catalog_metadata: Dict[str, Any]) -> List[Dict[str
"""
raise NotImplementedError("abstract method 'get_catalog_entries()' must be implemented")

@deprecated(
deprecated_in="3.7.0",
removed_in="4.0",
current_version=__version__,
details="Implement the get_entry_data function instead",
)
def read_catalog_entry(self, catalog_entry_data: Dict[str, Any], catalog_metadata: Dict[str, Any]) -> Optional[str]:
"""
DEPRECATED. Will be removed in 4.0. get_entry_data() must be implemented instead.

Reads a component definition for a single catalog entry using the catalog_entry_data returned
from get_catalog_entries() and, if needed, the catalog metadata.

:param catalog_entry_data: a dictionary that contains the information needed to read the content
of the component definition; below is an example data structure returned
from get_catalog_entries()

example:
{
"directory_path": "/Users/path/to/directory",
"relative_path": "subdir/file.py"
}

:param catalog_metadata: the metadata associated with the catalog in which this catalog entry is
stored; this is the same dictionary that is passed into get_catalog_entries();
in addition to catalog_entry_data, catalog_metadata may also be
needed to read the component definition for certain types of catalogs

:returns: the content of the given catalog entry's definition in string form, if found, or None;
if None is returned, this catalog entry is skipped and a warning message logged
"""
raise NotImplementedError("abstract method 'read_catalog_entry()' must be implemented")

def get_entry_data(
self, catalog_entry_data: Dict[str, Any], catalog_metadata: Dict[str, Any]
) -> Optional[EntryData]:
Expand Down Expand Up @@ -407,18 +372,18 @@ def read_with_thread():
)

try:
# Attempt to get an EntryData object from get_entry_data first
# Attempt to get an EntryData object from get_entry_data
entry_data: EntryData = self.get_entry_data(
catalog_entry_data=catalog_entry_data, catalog_metadata=catalog_metadata
)
except NotImplementedError:
# Connector class does not implement get_catalog_definition and we must
# manually coerce this entry's returned values into a EntryData object
definition = self.read_catalog_entry(
catalog_entry_data=catalog_entry_data, catalog_metadata=catalog_metadata
self.log.error(
f"Component catalog connector {self.__class__.__name__} cannot process catalog entry "
f"with identifying information {catalog_entry_data}. "
f"The connector does not implement method 'get_entry_data'."
)

entry_data: EntryData = EntryData(definition=definition)
catalog_entry_q.task_done()
continue

# Ignore this entry if no definition content is returned
if not entry_data or not entry_data.definition:
Expand Down