Skip to content

Commit

Permalink
fix: Use configured user in env var instead of "user" for Trino (feas…
Browse files Browse the repository at this point in the history
…t-dev#3254)

* use env var user

Signed-off-by: ammarar <[email protected]>

* lint fix

Signed-off-by: ammarar <[email protected]>

Signed-off-by: ammarar <[email protected]>
  • Loading branch information
ammarar authored and adchia committed Sep 30, 2022
1 parent 8abbcd9 commit e7ed3d5
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def pull_latest_from_table_or_query(
created_timestamp_column: Optional[str],
start_date: datetime,
end_date: datetime,
user: str = "user",
user: Optional[str] = None,
auth: Optional[Authentication] = None,
http_scheme: Optional[str] = None,
) -> TrinoRetrievalJob:
Expand All @@ -176,7 +176,6 @@ def pull_latest_from_table_or_query(
timestamps.append(created_timestamp_column)
timestamp_desc_string = " DESC, ".join(timestamps) + " DESC"
field_string = ", ".join(join_key_columns + feature_name_columns + timestamps)

client = _get_trino_client(
config=config, user=user, auth=auth, http_scheme=http_scheme
)
Expand Down Expand Up @@ -212,7 +211,7 @@ def get_historical_features(
registry: Registry,
project: str,
full_feature_names: bool = False,
user: str = "user",
user: Optional[str] = None,
auth: Optional[Authentication] = None,
http_scheme: Optional[str] = None,
) -> TrinoRetrievalJob:
Expand Down Expand Up @@ -303,7 +302,7 @@ def pull_all_from_table_or_query(
timestamp_field: str,
start_date: datetime,
end_date: datetime,
user: str = "user",
user: Optional[str] = None,
auth: Optional[Authentication] = None,
http_scheme: Optional[str] = None,
) -> RetrievalJob:
Expand Down Expand Up @@ -375,7 +374,10 @@ def _upload_entity_df_and_get_entity_schema(


def _get_trino_client(
config: RepoConfig, user: str, auth: Optional[Any], http_scheme: Optional[str]
config: RepoConfig,
user: Optional[str],
auth: Optional[Any],
http_scheme: Optional[str],
) -> Trino:
client = Trino(
user=user,
Expand Down

0 comments on commit e7ed3d5

Please sign in to comment.