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: update LOG_TZ type to pass pydantic validation #10066

Closed
wants to merge 1 commit into from

Conversation

yaoice
Copy link
Contributor

@yaoice yaoice commented Oct 30, 2024

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

Update LOG_TZ type to str so that is can pass pydantic validation.

Fixes #10061

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Oct 30, 2024
@yaoice yaoice force-pushed the fix/add-logtz-default-value branch 3 times, most recently from 735328b to af9d784 Compare October 30, 2024 10:18
@yaoice yaoice changed the title fix: set LOG_TZ default value fix: set LOG_TZ default value to pass pydantic validation Oct 30, 2024
@yaoice
Copy link
Contributor Author

yaoice commented Oct 30, 2024

@bowenliang123 @crazywoola help to reivew it, someone also encounter the same problem as issue description #10061 .

@bowenliang123
Copy link
Contributor

Quite surprised the problem you've encountered. It works well with the master branch code on my local environment. Or let me check again on this.

@yaoice yaoice force-pushed the fix/add-logtz-default-value branch from af9d784 to 9c7891f Compare October 30, 2024 12:07
@yaoice yaoice changed the title fix: set LOG_TZ default value to pass pydantic validation fix: update LOG_TZ type to pass pydantic validation Oct 30, 2024
@bowenliang123
Copy link
Contributor

bowenliang123 commented Oct 30, 2024

After double check, the problem was confirmed. Please revert #9595 fully, ensuring astimezone accepts the data in tzinfo type rather than string type (or it fails).

@bowenliang123
Copy link
Contributor

It still puzzles me that somehow the unit tests missed this case while it does includes the DifyCofing instance construction. If any default value violates the pydantic validation, it should fail.

@yaoice yaoice deleted the fix/add-logtz-default-value branch October 30, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LOG_TZ ValidationError
2 participants