-
Notifications
You must be signed in to change notification settings - Fork 64
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
Set
within property of type any
serialized to object instead of array
#430
Comments
Did some more investigating, looks to be a bug in Set serialization. Given the above, assigning
results in the following output Dynamo expression (trimmed for clarity),
If I update the schema of attribute
assigning
So the second example with the more explicit schema serializes to an array as expected, while the first incorrectly serializes to an object. |
Set
within property of type any
returning empty - possible bug?Set
within property of type any
serialized to object instead of array
Could you demonstrate this with a more complete code example? I want to make sure I fully understand, but it is a bit difficult for me without all the pieces. An example in the playground would be best but a snippet would also help 👍 |
No problem, below is an ElectroDB playground example that shows
Generated Dynamo expression,
|
I see -- you're right that this is unexpected, thank you for submitting this! |
Don't mention it! Let us know if there's anything we can do to help patch and/or test. |
@aqaengineering I took a look at this, and I have a question to clarify: What is your desired outcome here? |
@tywalch thanks for the follow-up. The desired outcome is to have the set property serialized to an equivalent representation when it's cast to
If helpful, the use case where this has come up is in duplicating a Dynamo record into another record, wherein the schema of the first record is verbose and changing quite frequently, so isn't desirable to model explicitly in the schema of the entity to which it's being duplicated. This approach has worked well for us in the past, just more recently having added a |
Hi @tywalch, just wanted to check in on this. We can take a look and try to put together a patch if helpful for you? |
Describe the bug
I have an entity schema (call it A) that includes an attribute (call it "b") of type
any
. The attribute is replicated from another entity with a different schema (call it B). Schema B includes an attribute (among others) of typeset
with string items. When retrieving entities of Schema A, attribute "b" correctly includes all of the properties of entity B, but the attribute of typeset
is an empty object (even if the the set isn't empty in the DynamoDB record of both entity A and B). Does Electro support this schema, or maybe a bug?Schema
ElectroDB Version
2.15.0
The text was updated successfully, but these errors were encountered: