I'm seeing a strange error trying to ingest a data...
# all-things-deployment
a
I'm seeing a strange error trying to ingest a dataset profile or usage, 'message': 'Failed to validate record with class com.linkedin.dataset.DatasetUsageStatistics: ERROR :: /partitionSpec/type :: unrecognized field found but not allowed\n', 'status': 422}),
Copy code
usageStats = DatasetUsageStatisticsClass(
            timestampMillis=1629840771000,
            uniqueUserCount=10,
            totalSqlQueries=20,
            fieldCounts=[
                DatasetFieldUsageCountsClass(
                    fieldPath="field1",
                    count=10
                )
            ]
        )

 # Construct a MetadataChangeProposalWrapper object.
    metadata_event = MetadataChangeProposalWrapper(
        entityType="dataset",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=builder.make_dataset_urn("myplatform", "path.to.my.table"),
        aspectName="datasetUsageStatistics",
        aspect=usageStats,
    )

    # Emit metadata! This is a blocking call
    emitter.emit(metadata_event)
i
Hello William! What version of datahub (cli & deployment) are you using?
This is a strange error, that said I was looking at the PDL definition of DataSetUsageStatistics. In the latest version at least,
topSqlQueries
is an array of strings, not a number. Is the 20 a typo?
If you could share the log it would be helpful to debug!
a
@incalculable-ocean-74010 - I'm using totalSqlQueries not topSqlQueries
let me check on the log
i
You’re right my bad 😅
a
so i upgraded to latest version and its working now, maybe related to the bug that .26 fixed
thank you 1