Hello GoodData team, For some attributes I am gett...
# gooddata-cn
a
Hello GoodData team, For some attributes I am getting Antichain='[attribute/<Attribute Name>/<workspace id>, has no witness, 400 error. What exactly it means?
v
Hi Andrei, this error means that there exists no attribute in the logical data model that would be reachable from all provided attributes. In other words, the provided attributes are incompatible. I'll use the Demo model as an example. If you use customer_id and campaign_id, those attributes are not directly comparable, so they form an "antichain", but they both (following the relationships set-up between datasets) can reach the order_line_id attribute, which means that order_line_id is a witness attribute. On the other hand, order_line_id and campaign_channel_id are also incomparable, but there is no other attribute that they can reach that could act as a witness, so using them both in a report would result in this error.
I'm not too familiar with Python SDK, but maybe you're looking for RelativeDateFilter or AbsoluteDateFilter
a
@Igor Strupinskiy ^
i
@Vojtech Tollar if there is a witness attribute like in your order_line_id and campaign_channel_id examples, does that mean gooddata would use the witness attribute under the hood to allow us to compare the otherwise incomparable attributes, and giving us a successful response?
What I am getting at is this: It seems we need some logic on our end to handle the no witness attribute scenario — do we also need to somehow error-handle an Antichain with a witness attribute?
v
@Igor Strupinskiy that's correct, in the resulting SQL the attributes will be joined to the table that has the witness. If you wish to avoid these errors, you may want to do it the same way as our UI applications do it. We are using the "validObjects" API, where you put in attributes, metrics, etc. and get back everything that can be added to the insight without errors. In Python SDK, it should be this
sdk.catalog_workspace_content.get_full_catalog(workspace).catalog_with_valid_objects(attributes)
i
I see — so basically 2 steps: 1. use the validObjects API to basically validate that our query is “Valid” — if not, raise a rich exception that explains why 2. if valid, then execute the query as @Andrei Salkov in his initial message?
v
Yes - or alternatively you can use validObjects to offer only attributes that will work
p
@rohit mathur fyi