-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
500s when patching column to a different type #1276
Comments
If |
Can I work on this? |
@Anish9901 I have assigned the issue to you. This issue blocks a lot of frontend work, so a core contributor might take it if it takes too long to be completed(more than 2-3 days) |
I'll try to get a PR in by a day or two @silentninja |
Thanks! @Anish9901 |
@kgodey There are a few display options that are required and are created along with a type, for example, the |
@silentninja I think if the frontend sends a request to remove all display options, the backend should treat it as a request to reset the display options to their default state (i.e. the user is removing all customizations). We should not let the display options end up in a unusable state. Alternatively, you can validate required display options, but the first option seems more flexible. |
|
@silentninja Here are my thoughts:
|
Sounds good to me. |
@silentninja FYI, patch requests to the same type (Text -> Text) also seem to be failing with similar errors. I assume the fix for this issue would apply to that scenario as well. |
After a lot of debug on resolving this issue, i come to know that actual bug was on Defination of class EmailDisplayOptionSerializer(MathesarErrorMessageMixin, OverrideRootPartialMixin, serializers.Serializer):
format = serializers.CharField(max_length=255, required=False) |
And in addition to this, we need to define a display option serializer for each Mathesar data type which includes |
@vrutik2809 The source of error is correct, but instead of having a serializer for all the types, it would be better to have a default serializer that would ignore any display options for types that don't accept any display options. The reason is that we should be able to handle unknown types too that are reflected from the database too |
Can we do like if |
@pavish @silentninja Since this issue is now closed can we uncomment |
@Anish9901 Thanks for pointing it out. Can you send a PR to uncomment it out |
@silentninja Sure working on it. |
Re-enable E2E test blocked by #1276
Description
When patching a column to a different type, having
display_options
ortype_options
in the request results in a 500 if the new type does not allow them.Scenario 1:
null
values for display and type options:Scenario 2:
{}
for display and type:Expected behavior
The text was updated successfully, but these errors were encountered: