Passing null values within a json to update_analysis()

Good morning!

I am experimenting with backing up an analysis with describe_analysis_definition() and restoring with update_analysis() and I ran into an issue with null representation. I am using boto3 version 1.26.66

My test backup .json has a section with a ‘null’ in it. This represents an integer filter on a visual where I want the values to be 30 or null

"Configuration": {
    "FilterListConfiguration": {
        "CategoryValues": [
            "30",
            null
        ],
        "MatchOperator": "CONTAINS"
    }
},

When attempting to call update_analysis() with the .json generated from describe_analysis_definition() I get this error:

Exception has occurred: ParamValidationError

Parameter validation failed: Invalid type for parameter Definition.FilterGroups[2].Filters[0].CategoryFilter.Configuration.FilterListConfiguration.CategoryValues[1], value: None, type: <class ‘NoneType’>, valid types: <class ‘str’>

I have attempted various different representations instead of ‘null’ in the .json to match the valid ‘str’ typing restriction:

  • “null”
  • “”
  • “NULL”

And none of this has worked. So any advice on how to restore a .json with a NULL value on a filter would be appreciated!

Hmm, so you have a working analysis and you said describe_analysis and then without updating the JSON it throws and error on update analysis?

Hey there Max!

My goal is to make a backup of an analysis in-case it goes through major changes, or we need to duplicate some of that work to another analysis

And yes, if I call update_analysis() with the .json that describe_analysis() generates I get an error thanks to the ‘null’ value present in the .json file in the FilterListConfiguration section. Even using the same AnalysisId in both functions I still get the ParamValidationError present in the original post

Just to confirm your analysis in quicksight is working now?

If it is, then I’ll mark this as a bug because it should be 1-1.

My analysis is working fine now yes!

I believe it might be a bug, as the describe_analysis() method creates a .json with a null value in the CategoryValues array inside FilterListConfiguration, but the update_analysis() method will only accept str values there