Andrei Salkov
07/05/2023, 7:55 PMAndrei Salkov
07/06/2023, 4:15 PMJan Kadlec
07/11/2023, 6:12 AMdates_table = sdk.tables.for_items(
workspace_id="demo",
items=[
Attribute(local_id="attr1", label="date.month"),
SimpleMetric(local_id="metric1", item=ObjId(type="fact", id="quantity")),
],
)
It is strange that you cannot see the date attribute using sdk.catalog_workspace_content.get_attributes_catalog(my_workspace_id)
. I tried it on demo
workspace and I can see date attributes there.
CatalogAttribute(id='date.year', type='attribute', json_api_entity=JsonApiEntityBase(id='date.year', type='attribute'), title='Date - Year', description='Year', tags=['Date'])
Jan Kadlec
07/11/2023, 6:56 AMJan Soubusta
07/11/2023, 9:56 AMJan Soubusta
07/11/2023, 9:57 AMAndrei Salkov
07/12/2023, 7:23 PMreturn sdk.tables.for_items(
workspace_id=gd_workspace_id,
items=[Attribute(local_id="AccountId", label="AccountId")],
filters=[
AbsoluteDateFilter(
dataset=ObjId(id="Account_EndDate", type="dataset"),
from_date="2022-05-05",
to_date="2023-06-05",
)
],
)
and
return sdk.tables.for_items(
workspace_id=gd_workspace_id,
items=[Attribute(local_id="Account_EndDate.year", label="Account_EndDate.year")],
filters=[
AbsoluteDateFilter(
dataset=ObjId(id="Account_EndDate", type="dataset"),
from_date="2022-05-05",
to_date="2023-06-05",
)
],
)
Here I have different items set. Second request fails with exception reason: Enumerating datetime attributes='[attribute/Account_EndDate.day....what exactly it means? What should be the correct attribute id?Andrei Salkov
07/12/2023, 8:38 PMattributes = sdk.catalog_workspace_content.get_attributes_catalog(gd_workspace_id)
print([attr for attr in attributes if attr.id=="Account_EndDate.year"])
I see the following response: [CatalogAttribute(id=Account_EndDate.year, title=Account enddate - Year, labels=[])]Jan Kadlec
07/13/2023, 7:35 AMJan Soubusta
07/13/2023, 8:31 AMAndrei Salkov
07/14/2023, 3:19 PMAndrei Salkov
07/21/2023, 4:49 PMJames Lee
07/24/2023, 5:51 PMJan Soubusta
07/24/2023, 6:01 PMJames Lee
07/24/2023, 6:22 PMJames Lee
07/24/2023, 6:47 PMJan Kadlec
07/24/2023, 6:49 PMJames Lee
07/24/2023, 7:24 PMJan Soubusta
07/24/2023, 7:26 PMJakub Sterba
07/24/2023, 7:35 PM