Skip to content

Commit

Permalink
Rename variable to prural
Browse files Browse the repository at this point in the history
  • Loading branch information
chezou committed Aug 28, 2024
1 parent b000278 commit 04c5500
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytd/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def write_dataframe(
self._bulk_import(table, fps, if_exists, fmt, max_workers=max_workers)
stack.close()

def _bulk_import(self, table, file_like, if_exists, fmt="csv", max_workers=5):
def _bulk_import(self, table, file_likes, if_exists, fmt="csv", max_workers=5):
"""Write a specified CSV file to a Treasure Data table.
This method uploads the file to Treasure Data via bulk import API.
Expand All @@ -482,7 +482,7 @@ def _bulk_import(self, table, file_like, if_exists, fmt="csv", max_workers=5):
table : :class:`pytd.table.Table`
Target table.
file_like : List of file like objects
file_likes : List of file like objects
Data in this file will be loaded to a target table.
if_exists : str, {'error', 'overwrite', 'append', 'ignore'}
Expand Down Expand Up @@ -528,7 +528,7 @@ def _bulk_import(self, table, file_like, if_exists, fmt="csv", max_workers=5):
logger.info(f"uploading data converted into a {fmt} file")
if fmt == "msgpack":
with ThreadPoolExecutor(max_workers=max_workers) as executor:
for i, fp in enumerate(file_like):
for i, fp in enumerate(file_likes):
fsize = fp.tell()
fp.seek(0)
executor.submit(
Expand All @@ -539,7 +539,7 @@ def _bulk_import(self, table, file_like, if_exists, fmt="csv", max_workers=5):
)
logger.debug(f"to upload {fp.name} to TD. File size: {fsize}B")
else:
fp = file_like[0]
fp = file_likes[0]
bulk_import.upload_file("part", fmt, fp)
bulk_import.freeze()
except Exception as e:
Expand Down

0 comments on commit 04c5500

Please sign in to comment.