CumulusCI icon indicating copy to clipboard operation
CumulusCI copied to clipboard

json parser error when empty string passed for date field during upsert or update

Open GeekStewie opened this issue 2 years ago • 4 comments

Describe the bug

I have a mapping file where the Birth Date is defined for the object Contact. After I have extracted the data from an org and it has created the .sql file, using the extract_dataset task, I have some dates populated and some are blank (this was the expected output).

However when I then run load_dataset, I get the following error for the rows with no Birth Date defined.

Error on record with id 28: JSON_PARSER_ERROR: Cannot deserialize instance of date from VALUE_STRING value or request may be missing a required field at [Source: N/A; line: -1, column: -1][line:-1, column:-1] ()

Adding a random date to these records, removes the errors and allows the records to insert but I would expect to be able to pass in a blank value for a date if it's a non-required field.

Reproduction steps

Add some Contact records to an org, make sure some of them have a birth date and some do not.

Create a mapping file which extracts fields from Contact. Ensure the standard field for Birth Date has been added.

Extract the data.

Load the data into a different org.

The error should show for rows without a value specified for Birth Date.

Your CumulusCI and Python versions

CumulusCI version: 3.61.1 (/usr/local/Cellar/cumulusci/3.61.1/libexec/bin/cci) Python version: 3.9.13 (/usr/local/opt/[email protected]/bin/python3.9)

Operating System

MacOS 12.4

Windows environment

No response

CumulusCI installation method

brew

Error Gist

No response

Additional information

No response

GeekStewie avatar Jul 12 '22 11:07 GeekStewie

@GeekStewie Can you attach or send me an example SQL/mapping file that causes this problem? My first attempts to reproduce have failed.

prescod avatar Aug 29 '22 20:08 prescod

Does your mapping file have reference to the relative date feature?

prescod avatar Aug 29 '22 20:08 prescod

@prescod I have created an example org where I have replicated the issue. See DM on Slack.

GeekStewie avatar Sep 08 '22 14:09 GeekStewie

Fixed in #3361

prescod avatar Sep 16 '22 01:09 prescod