OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Trino connector, support optional database field

Open dvecerdea opened this issue 4 years ago • 1 comments

Affected module Ingestion Framework, Trino Connector

Describe the bug Trino connector has an optional field 'database' described as follows: 'If you want to limit metadata ingestion to a single database, include the source.config.database field in your configuration file. If this field is not included, the connector will ingest metadata from all databases that the specified user is authorized to read'

When running ingestion ( openmetadata-ingestion, version 0.8.17dev1) with 'database' field empty or set to None, an error occurs that this field should not be None.

The reason seems to be that database field is not in fact optional: https://github.com/open-metadata/OpenMetadata/blob/29e42051ecd4763d2f6b456ecb79377c54b6fd37/ingestion/src/metadata/ingestion/source/trino.py#L47

Having set that field to Optional[str] however, does not make the ingestion to work properly. It does not ingest any database/table but the job succeeds.

To Reproduce Run a trino ingestion with database field set to None

Expected behavior If no database is set, ingestion framework should iterate over all databases in the set catalog and run ingestion for each

Version:

  • Python version:3.9
  • OpenMetadata version: 0.8.4
  • OpenMetadata Ingestion package version: openmetadata-ingestion[trino]==0.8.17dev1

dvecerdea avatar Mar 18 '22 14:03 dvecerdea

Thanks for filing this @dvecerdea . We will fix it right away

harshach avatar Mar 18 '22 14:03 harshach