Skip to content

Commit 11dd7c7

Browse files
authored
Initial fix (#573)
1 parent 535f1fc commit 11dd7c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

azure-kusto-ingest/azure/kusto/ingest/base_ingest_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import TYPE_CHECKING, Union, IO, AnyStr, Optional, Tuple
1111
from urllib.parse import urlparse
1212

13-
from azure.kusto.data.data_format import DataFormat
13+
from azure.kusto.data.data_format import DataFormat, IngestionMappingKind
1414
from azure.kusto.data.exceptions import KustoClosedError
1515
from .descriptors import FileDescriptor, StreamDescriptor
1616
from .ingestion_properties import IngestionProperties
@@ -122,7 +122,7 @@ def ingest_from_dataframe(
122122

123123
# If we are given CSV mapping, or the mapping format is explicitly set to CSV, we should use CSV
124124
if not data_format:
125-
if ingestion_properties is not None and (ingestion_properties.ingestion_mapping_type == DataFormat.CSV):
125+
if ingestion_properties is not None and (ingestion_properties.ingestion_mapping_type == IngestionMappingKind.CSV):
126126
is_json = False
127127
elif data_format == DataFormat.CSV:
128128
is_json = False
@@ -138,7 +138,7 @@ def ingest_from_dataframe(
138138
df.to_json(temp_file, orient="records", date_format="iso", lines=True)
139139
ingestion_properties.format = DataFormat.JSON
140140
else:
141-
df.to_csv(temp_file_path, index=False, encoding="utf-8", header=False)
141+
df.to_csv(temp_file, index=False, encoding="utf-8", header=False)
142142
ingestion_properties.ignore_first_record = False
143143
ingestion_properties.format = DataFormat.CSV
144144

0 commit comments

Comments
 (0)