Skip to content

Commit 12c4e5a

Browse files
authored
SNOW-646302: Add telemetry for write_pandas (#1242)
1 parent 4930a51 commit 12c4e5a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/snowflake/connector/pandas_tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from snowflake.connector import ProgrammingError
2020
from snowflake.connector.options import pandas
21+
from snowflake.connector.telemetry import TelemetryData, TelemetryField
2122

2223
if TYPE_CHECKING: # pragma: no cover
2324
from .connection import SnowflakeConnection
@@ -279,6 +280,7 @@ def write_pandas(
279280
)
280281
logger.debug(f"copying into with '{copy_into_sql}'")
281282
copy_results = cursor.execute(copy_into_sql, _is_internal=True).fetchall()
283+
cursor._log_telemetry_job_data(TelemetryField.PANDAS_WRITE, TelemetryData.TRUE)
282284
cursor.close()
283285
return (
284286
all(e[1] == "LOADED" for e in copy_results),

src/snowflake/connector/telemetry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class TelemetryField(Enum):
3737
# fetch_arrow_* usage
3838
ARROW_FETCH_ALL = "client_fetch_arrow_all"
3939
ARROW_FETCH_BATCHES = "client_fetch_arrow_batches"
40+
# write_pandas usage
41+
PANDAS_WRITE = "client_write_pandas"
4042
# imported packages along with client
4143
IMPORTED_PACKAGES = "client_imported_packages"
4244
# Keys for telemetry data sent through either in-band or out-of-band telemetry

0 commit comments

Comments
 (0)