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

DynamoDbIgnoreNulls is not working as expected #3542

Closed
dariellbowo opened this issue Nov 11, 2022 · 2 comments
Closed

DynamoDbIgnoreNulls is not working as expected #3542

dariellbowo opened this issue Nov 11, 2022 · 2 comments
Labels
duplicate This issue is a duplicate. dynamodb-enhanced feature-request A feature should be added or improved.

Comments

@dariellbowo
Copy link

dariellbowo commented Nov 11, 2022

This is a duplicate of #3499

I am using DynamoDB Enhanced Client to update partial attribute.

Reproduction Steps

@DynamoDbBean
public abstract class Parent {
    private Integer id;
    private Instant createdTimestamp;
    
    @DynamoDbPartitionKey
    @DynamoDbAttribute("id")
    public Integer getAccountId() {
        return id;
    }

    @DynamoDbAttribute("created_timestamp")
    @DynamoDbUpdateBehavior(UpdateBehavior.WRITE_IF_NOT_EXISTS)
    @DynamoDbAutoGeneratedTimestampAttribute
    public Instant getCreatedTimestamp() {
        return createdTimestamp;
    }
}
@DynamoDbBean
public class Child{
    private String attribute1;
    private String attribute2;

    @DynamoDbAttribute("attribute_1")
    @DynamoDbIgnoreNulls
    public String getAttribute1() {
        return attribute1;
    }

    @DynamoDbAttribute("attribute_2")
    @DynamoDbIgnoreNulls
    public String getAttribute2() {
        return attribute2;
    }
}

client = enhancedAsyncClient.table(tableName, TableSchema.fromBean(Child.class));

Child child = new Child(777, "someValue1", "someValue2");
client.updateItem(child);

Child updatedChild = new Child(777, "someValue3");
enhancedAsyncClient.table(tableName, TableSchema.fromBean(Child.class)).updateItem(child);
client.updateItem(updatedChild);
// After this statement attribute2 will be empty while attribute1 is updated to "someValue3"

Originally posted by @dariellbowo in #3499 (comment)

@debora-ito debora-ito added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. dynamodb-enhanced labels Jul 31, 2024
@debora-ito
Copy link
Member

The DynamoDB Enhanced client doesn't support polymorphism yet, we are tracking this feature here: #1870.

Closing this as a duplicate.

@debora-ito debora-ito added duplicate This issue is a duplicate. feature-request A feature should be added or improved. and removed needs-triage This issue or PR still needs to be triaged. bug This issue is a bug. labels Sep 3, 2024
@debora-ito debora-ito closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate. dynamodb-enhanced feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants