1010from typing import TYPE_CHECKING , Union , IO , AnyStr , Optional , Tuple
1111from urllib .parse import urlparse
1212
13- from azure .kusto .data .data_format import DataFormat
13+ from azure .kusto .data .data_format import DataFormat , IngestionMappingKind
1414from azure .kusto .data .exceptions import KustoClosedError
1515from .descriptors import FileDescriptor , StreamDescriptor
1616from .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