Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ds-platform-utils"
version = "0.3.0"
version = "0.3.1"
description = "Utility library for Pattern Data Science."
readme = "README.md"
authors = [
Expand Down
12 changes: 6 additions & 6 deletions src/ds_platform_utils/metaflow/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@ def query_pandas_from_snowflake(
substitute_map_into_string,
)

# adding query tags comment in query for cost tracking in select.dev
tags = get_select_dev_query_tags()
query_comment_str = f"\n\n/* {json.dumps(tags)} */"
query = get_query_from_string_or_fpath(query)
query = add_comment_to_each_sql_statement(query, query_comment_str)

if "{{schema}}" in query or "{{ schema }}" in query:
schema = PROD_SCHEMA if current.is_production else NON_PROD_SCHEMA
query = substitute_map_into_string(query, {"schema": schema})
Expand All @@ -197,6 +191,12 @@ def query_pandas_from_snowflake(
current.card.append(Markdown("## Querying Snowflake Table"))
current.card.append(Markdown(f"```sql\n{query}\n```"))

# adding query tags comment in query for cost tracking in select.dev
tags = get_select_dev_query_tags()
query_comment_str = f"\n\n/* {json.dumps(tags)} */"
query = get_query_from_string_or_fpath(query)
query = add_comment_to_each_sql_statement(query, query_comment_str)

conn: SnowflakeConnection = get_snowflake_connection(use_utc)
if warehouse is not None:
_execute_sql(conn, f"USE WAREHOUSE {warehouse};")
Expand Down
Loading