Skip to content
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

PathProperties._from_generated raises exception if last_modified is empty #23834

Closed
blem14 opened this issue Apr 6, 2022 · 3 comments
Closed
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Lake Storage Gen2 needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)

Comments

@blem14
Copy link

blem14 commented Apr 6, 2022

  • Package Name: azure-storage-file-datalake
  • Package Version: 12.6.0
  • Operating System: Windows 11 x64
  • Python Version: 3.9.7

Describe the bug
Listing paths may fail on directories with empty last_modified.
Introduced in PR #16093.

To Reproduce
Steps to reproduce the behavior:

  1. Have directory/file in the datalake without last_modified filled.
  2. Run
    from azure.storage.filedatalake import DataLakeServiceClient
    service_client = DataLakeServiceClient(url, credential)
    fs_client = service_client.get_file_system_client(file_system)
    for p in fs_client.get_paths():
        print(p.name)
  3. Get TypeError: strptime() argument 1 must be str, not None at azure/storage/filedatalake/_models.py:224.

Expected behavior
Listing directories not failing on directories/files with empty last_modified.
If last_modified can't be cast to datetime.datetime, it should be None.

Additional context
Not sure how last_modified ended up being empty in the first place, but I've met with such case on client's datalake.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2022
@azure-sdk azure-sdk added Client This issue points to a problem in the data-plane of the library. Data Lake Storage Gen2 needs-team-triage Workflow: This issue needs the team to triage. labels Apr 6, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 6, 2022
@l0lawrence
Copy link
Member

Thanks for the feedback, we'll investigate this asap.

@l0lawrence l0lawrence removed the needs-team-triage Workflow: This issue needs the team to triage. label Apr 6, 2022
@jalauzon-msft jalauzon-msft added the Storage Storage Service (Queues, Blobs, Files) label Apr 6, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 6, 2022
@jalauzon-msft jalauzon-msft added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2022
@jalauzon-msft
Copy link
Member

Hi @blem14, thanks for reporting this and doing a bit of investigation to figure out the issue! I'm also not really sure how a file/directory would end up with no last_modified time from the server, that seems odd. Either way, this does seem like a case we should handle. I'm making changes in this area for the upcoming release, I'll go ahead and fix it there as well.

@jalauzon-msft
Copy link
Member

This has been merged and will be part of our upcoming release.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Lake Storage Gen2 needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants