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

fix(ingest/looker): correct looker/lookml capability reports #7683

Merged
merged 2 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import datahub.emitter.mce_builder as builder
from datahub.configuration.common import AllowDenyPattern, ConfigurationError
from datahub.configuration.source_common import DatasetSourceConfigMixin
from datahub.configuration.source_common import DatasetSourceConfigMixin, EnvConfigMixin
from datahub.configuration.validate_field_removal import pydantic_removed_field
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.mcp_builder import create_embed_mcp
Expand Down Expand Up @@ -106,7 +106,7 @@ class LookerDashboardSourceConfig(
LookerAPIConfig,
LookerCommonConfig,
StatefulIngestionConfigBase,
DatasetSourceConfigMixin,
EnvConfigMixin,
):
_removed_github_info = pydantic_removed_field("github_info")

Expand Down Expand Up @@ -168,23 +168,18 @@ def external_url_defaults_to_api_config_base_url(
) -> Optional[str]:
return v or values.get("base_url")

@validator("platform_instance")
def platform_instance_not_supported(cls, v: Optional[str]) -> Optional[str]:
if v is not None:
raise ConfigurationError("Looker Source doesn't support platform instances")
return v


@platform_name("Looker")
@support_status(SupportStatus.CERTIFIED)
@config_class(LookerDashboardSourceConfig)
@capability(SourceCapability.DESCRIPTIONS, "Enabled by default")
@capability(SourceCapability.PLATFORM_INSTANCE, "Enabled by default")
@capability(SourceCapability.PLATFORM_INSTANCE, "Not supported", supported=False)
@capability(
SourceCapability.OWNERSHIP, "Enabled by default, configured using `extract_owners`"
)
@capability(
SourceCapability.USAGE_STATS, "Can be enabled using `extract_usage_history`"
SourceCapability.USAGE_STATS,
"Enabled by default, configured using `extract_usage_history`",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this decorator actually do? Does this update the docs or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup it feeds into our doc generation system

)
class LookerDashboardSource(TestableSource, StatefulIngestionSourceBase):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
from datahub.ingestion.api.common import PipelineContext
from datahub.ingestion.api.decorators import (
SupportStatus,
capability,
config_class,
platform_name,
support_status,
)
from datahub.ingestion.api.registry import import_path
from datahub.ingestion.api.source import SourceCapability
from datahub.ingestion.api.workunit import MetadataWorkUnit
from datahub.ingestion.source.common.subtypes import DatasetSubTypes
from datahub.ingestion.source.git.git_import import GitClone
Expand Down Expand Up @@ -175,7 +177,7 @@ def from_looker_connection(


class LookMLSourceConfig(
LookerCommonConfig, StatefulIngestionConfigBase, DatasetSourceConfigMixin
LookerCommonConfig, StatefulIngestionConfigBase, EnvConfigMixin
):
git_info: Optional[GitInfo] = Field(
None,
Expand Down Expand Up @@ -237,14 +239,6 @@ class LookMLSourceConfig(
default=None, description=""
)

@validator("platform_instance")
def platform_instance_not_supported(cls, v: Optional[str]) -> Optional[str]:
if v is not None:
raise ConfigurationError(
"LookML Source doesn't support platform instance at the top level. However connection-specific platform instances are supported for generating lineage edges. Read the documentation to find out more."
)
return v

@validator("connection_to_platform_map", pre=True)
def convert_string_to_connection_def(cls, conn_map):
# Previous version of config supported strings in connection map. This upconverts strings to ConnectionMap
Expand Down Expand Up @@ -1094,6 +1088,9 @@ class LookerManifest:
@platform_name("Looker")
@config_class(LookMLSourceConfig)
@support_status(SupportStatus.CERTIFIED)
@capability(SourceCapability.PLATFORM_INSTANCE, "Not supported", supported=False)
@capability(SourceCapability.LINEAGE_COARSE, "Supported by default")
@capability(SourceCapability.LINEAGE_FINE, "Enabled by default, configured using `extract_column_level_lineage`")
class LookMLSource(StatefulIngestionSourceBase):
"""
This plugin extracts the following:
Expand Down