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

Fixed date type var bug #3301

Closed

Conversation

Snaipergelka
Copy link
Contributor

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Fixed bug with date time and date types of reflex.Var.

Added check_type_in_var_is_string_type function that checks if value type in global set StringVarType of types that should be used as a string literal and then sets _var_is_string=true.

If there will be a need to add more types that should be considered as strings, just add them in set StringVarType.

Seems that it solves the problem.

Closes #3235

@benedikt-bartscher
Copy link
Contributor

@Snaipergelka StringVarType is not adjustable by users if i am not mistaken.
If users can define their own serializers, they should also be able to inform reflex that smth is serialized as a string.
Take a look at my related pr: #3227

@Snaipergelka
Copy link
Contributor Author

@Snaipergelka StringVarType is not adjustable by users if i am not mistaken. If users can define their own serializers, they should also be able to inform reflex that smth is serialized as a string. Take a look at my related pr: #3227

@benedikt-bartscher yes, StringVarType is not adjustable by users. It is rather a hot fix for dates and date times (and other types if needed) to mark them as strings without additional information from user.

I guess your solution is more wide.

@masenf
Copy link
Collaborator

masenf commented Jun 4, 2024

Thank you for the contribution 🙏 .

We will ultimately take the more generic fix in #3227 to address this issue.

@Snaipergelka please feel free to review or make comments over there.

@masenf masenf closed this Jun 4, 2024
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.

[REF-3009] Serializer type conversion not respected
3 participants