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

[DOP-15561] Cast DateTimeHWM to DateTime64 in Clickhouse #267

Merged
merged 1 commit into from Apr 27, 2024

Conversation

dolfinus
Copy link
Member

@dolfinus dolfinus commented Apr 26, 2024

Change Summary

DateTime precision in Clickhouse is only up to seconds. So using DateTimeHWM on column with higher precision, like DateTime64, can lead to reading the same value twice because fractional part of second is ignored.

Cast Python datetime type to DateTime64(6) in Clickhouse, keeping fractions of seconds. In case of using old Clickhouse versions (20.7 .. 21.0), users might have to update hwm.expression value, so this is a breaking change.

Related issue number

Checklist

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@dolfinus dolfinus marked this pull request as ready for review April 26, 2024 13:25
Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.34%. Comparing base (96ce940) to head (298c705).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #267   +/-   ##
========================================
  Coverage    94.34%   94.34%           
========================================
  Files          204      204           
  Lines         7963     7963           
  Branches      1408     1408           
========================================
  Hits          7513     7513           
  Misses         325      325           
  Partials       125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dolfinus dolfinus merged commit 02e22fd into develop Apr 27, 2024
33 checks passed
@dolfinus dolfinus deleted the bugfix/DOP-15561 branch April 27, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants