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

[fix] Zipping files older than 1980 #1914

Merged
merged 8 commits into from
Sep 12, 2024
Merged

[fix] Zipping files older than 1980 #1914

merged 8 commits into from
Sep 12, 2024

Conversation

qTipTip
Copy link
Contributor

@qTipTip qTipTip commented Sep 5, 2024

Description

From the docs: https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile

The strict_timestamps argument, when set to False, allows to zip files older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. Similar behavior occurs with files newer than 2107-12-31, the timestamp is also set to the limit.

We have been seeing some of these errors when creating functions lately. Not sure why they sporadically show up:

ValueError: ZIP does not support timestamps before 1980

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

@qTipTip qTipTip requested review from a team as code owners September 5, 2024 12:32
@qTipTip qTipTip requested review from arnels and removed request for a team September 5, 2024 12:32
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.86%. Comparing base (f639cb2) to head (999489b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1914   +/-   ##
=======================================
  Coverage   90.86%   90.86%           
=======================================
  Files         130      130           
  Lines       20157    20157           
=======================================
  Hits        18315    18315           
  Misses       1842     1842           
Files with missing lines Coverage Δ
cognite/client/_api/functions.py 94.95% <100.00%> (ø)
cognite/client/_version.py 100.00% <100.00%> (ø)

@@ -58,7 +58,8 @@

MAX_RETRIES = 5
REQUIREMENTS_FILE_NAME = "requirements.txt"
REQUIREMENTS_REG = re.compile(r"(\[\/?requirements\]){1}$", flags=re.M) # Matches [requirements] and [/requirements]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the changes here are linting fmt.

Copy link
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.md Outdated Show resolved Hide resolved
@qTipTip qTipTip enabled auto-merge (squash) September 11, 2024 11:22
@qTipTip qTipTip added the auto-update Will automatically keep PR up to date label Sep 11, 2024
@qTipTip qTipTip merged commit 66879d4 into master Sep 12, 2024
13 checks passed
@qTipTip qTipTip deleted the fix-zip branch September 12, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-update Will automatically keep PR up to date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants