-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload entire file content to ADLS GEN2 using Python SDK #36462
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jalauzon-msft @vincenttran-msft. |
Hi @nupoor01nawathey Nupoor, thanks for reaching out. Could you please share a code snippet showing how you are constructing your client and how you are uploading your data? It is difficult for us to reproduce without a code sample. Thanks. |
Hi @nupoor01nawathey. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi @nupoor01nawathey Nupoor, thanks for sharing the code. Here are several suggestions to try and address the issue. If none of these work, we can look more closely.
# Open and read the file into memory
with open(local_file_path, 'rb') as local_file:
file_contents: bytes = local_file.read()
# Pass file handle directly
file_client = dir_client.create_file(file_name)
with open(local_file_path, 'rb') as local_file:
file_client.append_data(local_file, 0, len(local_file))
file_client.flush(len(local_file))
with open(local_file_path, 'rb') as local_file:
# You need to pass overwrite=True to create the file.
file_client.upload_data(local_file, overwrite=True) Hopefully one of these suggestions can help but please let us know if not, thanks. |
@pvaneck Thanks for the quick response, the 3rd solution you provided is working fine.
|
Hi @nupoor01nawathey. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
Hi @nupoor01nawathey, since you haven’t asked that we |
Describe the bug
While uploading file to ADLS2 using Python SDK DatalakeServiceClient , complete file contents are not uploaded on the ADLS2 container. There is no error in the output. When printed file content I can see full data there, but the last 2 rows from the file are not loaded to the target ADLS2. Small file is getting uploaded properly. Not sure if there's any limitation to content length here. Checked append_data and flush_data methods but not able to understand what's the root cause.
Content length: 359254
File type that is expected to be loaded: csv
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Entire file content should be uploaded to the container / folder.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
When uploaded same file content using BlobClient it's working fine.
The text was updated successfully, but these errors were encountered: