Skip to content

fix: handle tzinfo in HH format in local mode - #537

Merged
joein merged 4 commits into
devfrom
fix-dt-format-local-mode
Mar 13, 2024
Merged

joein merged 4 commits into
devfrom
fix-dt-format-local-mode

Conversation

@joein

@joein joein commented Mar 12, 2024

Copy link
Copy Markdown
Member

No description provided.

@joein
joein requested a review from coszio March 12, 2024 21:44
@netlify

netlify Bot commented Mar 12, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit ef280a4
🔍 Latest deploy log https://app.netlify.com/sites/poetic-froyo-8baba7/deploys/65f1bbca6836aa000814370f
😎 Deploy Preview https://deploy-preview-537--poetic-froyo-8baba7.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 configuration.

@joein

joein commented Mar 12, 2024

Copy link
Copy Markdown
Member Author

#511

Comment thread qdrant_client/local/datetime_utils.py Outdated
Comment on lines +41 to +57
parsed_dt = parse_available_formats(date_str)
if parsed_dt is not None:
return parsed_dt

if "+" in date_str:
dt_str, tz_str = date_str.split("+")
tz_offset = int(tz_str.lower().replace("z", ""))
elif "-" in date_str[-4:]:
dt_str, tz_str = date_str.rsplit("-", 1)
tz_offset = -int(tz_str.lower().replace("z", ""))
else:
return None

parsed_dt = parse_available_formats(dt_str)
if parsed_dt is not None:
parsed_dt = parsed_dt.replace(tzinfo=timezone(timedelta(hours=tz_offset)))
return parsed_dt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not trivial part, requires more comments/examples

@joein
joein requested a review from generall March 13, 2024 14:45
@joein
joein merged commit 185121e into dev Mar 13, 2024
joein added a commit that referenced this pull request Mar 27, 2024
* fix: handle tzinfo in HH format in local mode

* fix: fix mypy

* fix: replace dt split by trying adding minutes to tz (#540)

* refactoring: remove redundant import
@generall
generall deleted the fix-dt-format-local-mode branch May 3, 2024 10:50
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.

2 participants