Skip to content

Commit

Permalink
Merge pull request #506 from DagsHub/bug/timezone-introspection
Browse files Browse the repository at this point in the history
Bug: Filter the metadata fields based on the introspection
  • Loading branch information
kbolashev authored Jul 21, 2024
2 parents f24aac7 + 766c502 commit 3a0baaf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dagshub/data_engine/client/gql_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def datasource_params(id: Optional[Union[int, str]], name: Optional[str]) -> Dic
@staticmethod
@functools.lru_cache()
def datasource_query(include_metadata: bool, introspection: "TypesIntrospection") -> GqlQuery:
metadata_fields = "metadata { key value timeZone }" if include_metadata else ""
metadata_fields = ""
if include_metadata:
# Filter out the unavailable fields
queryable_fields = ["key", "value", "timeZone"]
queryable_fields = Validators.filter_supported_fields(queryable_fields, "MetadataField", introspection)
metadata_fields = "metadata " + "{" + " ".join(queryable_fields) + "}"
q = (
GqlQuery()
.operation(
Expand Down

0 comments on commit 3a0baaf

Please sign in to comment.