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

Change Storage put_directory to only count the number of files uploaded #7054

Merged
merged 3 commits into from Oct 3, 2022

Conversation

taljaards
Copy link
Contributor

@taljaards taljaards commented Oct 3, 2022

Deployment().upload_to_storage() returns the number of files uploaded (obtained from the relevant storage/filesystem put_directory()). It caught me off-guard in that it seems to upload more files than I have in my folder.

Example

I found, for example, for the test tree-project, it returns 7 files uploaded.
That is because it also counts the folders.
image

Important: This PR changes the behavior of the file counter to only count the files, and not the folders as well.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@netlify
Copy link

netlify bot commented Oct 3, 2022

Deploy Preview for prefect-orion ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7395a0a
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/633af295b498c70009ef49b5
😎 Deploy Preview https://deploy-preview-7054--prefect-orion.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@zanieb zanieb added the enhancement An improvement of an existing feature label Oct 3, 2022
Copy link
Contributor

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks makes sense to me!

@zanieb zanieb merged commit f8c18f9 into PrefectHQ:main Oct 3, 2022
@taljaards taljaards deleted the Fix_Storage_put_count branch October 4, 2022 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants