Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-yzou committed Oct 1, 2024
1 parent b705d71 commit f4f51f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions tests/integ/test_cte.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
reason="CTE is a SQL feature",
run=False,
),
pytest.mark.skipif(
(not installed_pandas),
reason="SQL Counter requires pandas",
run=False,
),
]

binary_operations = [
Expand Down
9 changes: 5 additions & 4 deletions tests/integ/utils/sql_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
import sys
import threading
import traceback
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Union

import pytest
from decorator import decorator
from pandas._typing import Scalar

from snowflake.snowpark.query_history import QueryRecord
from snowflake.snowpark.session import Session
from tests.utils import IS_IN_STORED_PROC

PythonScalar = Union[str, float, bool]

UPDATED_SUFFIX = "updated"
ORIGINAL_SUFFIX = "original"
STATUS_REPORT_FILE = "sql_counter_report.txt"
Expand Down Expand Up @@ -419,7 +420,7 @@ def get_readable_sql_count_values(tr):


def update_test_code_with_sql_counts(
sql_count_records: Dict[str, Dict[str, List[Dict[str, Optional[Scalar]]]]]
sql_count_records: Dict[str, Dict[str, List[Dict[str, Optional[PythonScalar]]]]]
):
"""This helper takes sql count records and rewrites the source test files to validate sql counts where possible.
Expand All @@ -431,7 +432,7 @@ def update_test_code_with_sql_counts(
last_status_file = None

# Iterate through each sql count record, this is nested dictionary structured as:
# sql_count_records[test_file][test_name] -> dict[Str, Scalar]
# sql_count_records[test_file][test_name] -> dict[Str, PythonScalar]
# The valid keys are:
# "test_name" for alternative reference
# "test_parms" if the test is parameterized
Expand Down

0 comments on commit f4f51f8

Please sign in to comment.