Skip to content

Add option to ingore order of array items (but check schema of array items) #146

@quickdraw6906

Description

@quickdraw6906

If structure of array items differs only in the ordering of columns chispa still throws SchemasNotEqualError when ignore_column_order is passed

chispa.assert_df_equality(merge_df, expected_df, ignore_row_order=True, ignore_column_order=True)

chispa.schema_comparer.SchemasNotEqualError:

| StructField('representatives', ArrayType(StructType([StructField('updated_at', StringType(), True), StructField('id', StringType(), True), StructField('aa_id', StringType(), True), StructField('rep_number', DoubleType(), True), StructField('person_info', StructType([StructField('first_name', StringType(), True), StructField('last_name', StringType(), True), StructField('email', StringType(), True)]), True)]), False), False) | StructField('representatives', ArrayType(StructType([StructField('id', StringType(), True), StructField('aa_id', StringType(), True), StructField('rep_number', DoubleType(), True), StructField('updated_at', StringType(), True), StructField('person_info', StructType([StructField('first_name', StringType(), True), StructField('last_name', StringType(), True), StructField('email', StringType(), True)]), True)]), False), False)

Describe the solution you would like
Honor ignore_column_order for StructTypes that are array items.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions