Skip to content

Commit

Permalink
vdk-core: ingest logging formatting bug (#2836)
Browse files Browse the repository at this point in the history
The logs were not replacing the method name because the f-string was
missing the `f"` so this is fixed.

Slightly simplified the error message to make it easier to understand I
hope

Signed-off-by: Antoni Ivanov <[email protected]>
  • Loading branch information
antoniivanov authored Nov 13, 2023
1 parent cdf3a14 commit 16793ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def __get_ingester(self, method: str) -> IngesterBase:
else:
errors.report_and_throw(
VdkConfigurationError(
"Provided method, {method}, has invalid value.",
"VDK was run with method={method}, however {method} is not part of the available ingestion mechanisms.",
f"Provided method, {method}, has invalid value."
f"VDK was run with method={method}, however {method} is not part of the available ingestion methods."
f"Provide either valid value for method, or install ingestion plugin that supports this type. "
f"Currently possible values are {list(self._ingester_builders.keys())}",
f"Currently possible values are {list(self._ingester_builders.keys())}"
)
)

Expand Down Expand Up @@ -217,15 +217,9 @@ def __initialize_processor(self, method) -> Optional[IIngesterPlugin]:
if processor_plugin is None:
errors.report_and_throw(
VdkConfigurationError(
"Could not create new processor plugin of type" f" {method}.",
f"VDK was run with method={method}, however "
"no valid ingestion processor plugin was "
"created.",
"Seems to be a bug in the plugin for method"
f" {method}. Make sure it's correctly "
f"installed. If upgraded recently, consider"
" reverting to previous version. Or use "
"another method type.",
"Could not create new processor plugin of method: " f"{method}.",
f"Currently possible processor methods are {list(self._ingester_builders.keys())}. "
"Make sure the processing configuration value are correct and the plugin is installed. ",
)
)
return processor_plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,4 @@ def test_router_raise_error_chained_ingest_plugins_not_registered():
router.send_tabular_data_for_ingestion(rows=["b"], column_names=["a"])

error_msg = exc_info.value
assert "Could not create new processor plugin of type pre-ingest-test" in str(
error_msg
)
assert "method: pre-ingest-test" in str(error_msg)

0 comments on commit 16793ad

Please sign in to comment.