Skip to main content
Solved

Retrieve column types through Automation API 1.0

  • Feb 23, 2025 8:16 AM UTC
  • 1 reply
  • 70 views
  • Translate All

Hi everyone,

I'm working with the ODS Automation API (v1) and I'm trying to retrieve the data types of columns in a dataset. When using the `/datasets/{dataset_uid}/fields` endpoint, I receive a list of field configurations that includes annotations (facet, timerangeFilter, etc.) and rename operations, but I'm having trouble finding the actual data types of the columns (like text, date, integer).

Here's an example of what I get from the endpoint (for fields related to the ‘end_date’ field, which is of type ‘date’):

[
{'annotation': 'facet', 'args': [], 'field': 'end_date', 'label': '', 'type': 'annotation', 'uid': 'pr_toc04f'}
{'annotation': 'facetsort', 'args': ['alphanum'], 'field': 'end_date', 'label': '', 'type': 'annotate', 'uid': 'pr_adjonu'}
{'annotation': 'timerangeFilter', 'args': [], 'field': 'end_date', 'label': '', 'type': 'annotate', 'uid': 'pr_yv06h9'}
{'field_label': 'Enddatum', 'from_name': 'end_date', 'label': '', 'to_name': 'end_date', 'type': 'rename', 'uid': 'pr_xh8w8e'}
]

What I'm hoping to determine is whether each field is a text, date, integer, etc. Is there another endpoint I should be using, or am I missing something in the current response?

Thanks for your help!

 

Appendix

 

For the sake of completeness, here is all information I know.

I am working with this dataset with the following information in the schema:

 

label,name,type

ID,id,text
Jahr,year,date
Name,name,text
Startdatum,start_date,date
Enddatum,end_date,date

 

An here is the entire response json:

[{'uid': 'pr_h0l0hl', 'label': '', 'type': 'annotate', 'annotation': 'facet', 'args': [], 'field': 'year'},
{'uid': 'pr_dqgzrb', 'label': '', 'type': 'type', 'field': 'year', 'type_param': 'date'},
{'uid': 'pr_agoe06', 'label': '', 'type': 'annotate', 'annotation': 'timeserie_precision', 'args': ['year'], 'field': 'year'},
{'uid': 'pr_qzb58f', 'label': '', 'type': 'annotate', 'annotation': 'timerangeFilter', 'args': [], 'field': 'year'},
{'uid': 'pr_kqgusz', 'label': '', 'type': 'annotate', 'annotation': 'facet', 'args': [], 'field': 'name'},
{'uid': 'pr_a0e1ri', 'label': '', 'type': 'annotate', 'annotation': 'facetsort', 'args': ['alphanum'], 'field': 'name'},
{'uid': 'pr_45yy8o', 'label': '', 'type': 'annotate', 'annotation': 'disjunctive', 'args': [], 'field': 'name'},
{'uid': 'pr_ds61wy', 'label': '', 'type': 'annotate', 'annotation': 'sortable', 'args': [], 'field': 'name'},
{'uid': 'pr_247lrl', 'label': '', 'type': 'annotate', 'annotation': 'facet', 'args': [], 'field': 'start_date'},
{'uid': 'pr_cbln95', 'label': '', 'type': 'annotate', 'annotation': 'facetsort', 'args': ['alphanum'], 'field': 'start_date'},
{'uid': 'pr_3nm5em', 'label': '', 'type': 'annotate', 'annotation': 'timerangeFilter', 'args': [], 'field': 'start_date'},
{'uid': 'pr_toc04f', 'label': '', 'type': 'annotate', 'annotation': 'facet', 'args': [], 'field': 'end_date'},
{'uid': 'pr_adjonu', 'label': '', 'type': 'annotate', 'annotation': 'facetsort', 'args': ['alphanum'], 'field': 'end_date'},
{'uid': 'pr_yv06h9', 'label': '', 'type': 'annotate', 'annotation': 'timerangeFilter', 'args': [], 'field': 'end_date'},
{'uid': 'pr_hswk9z', 'label': '', 'type': 'annotate', 'annotation': 'facetsort', 'args': ['alphanum'], 'field': 'year'},
{'uid': 'pr_r19k2z', 'label': '', 'type': 'rename', 'from_name': 'name', 'to_name': 'name', 'field_label': 'Name'},
{'uid': 'pr_dzxim2', 'label': '', 'type': 'rename', 'from_name': 'year', 'to_name': 'year', 'field_label': 'Jahr'},
{'uid': 'pr_tv88xq', 'label': '', 'type': 'rename', 'from_name': 'start_date', 'to_name': 'start_date', 'field_label': 'Startdatum'},
{'uid': 'pr_xh8w8e', 'label': '', 'type': 'rename', 'from_name': 'end_date', 'to_name': 'end_date', 'field_label': 'Enddatum'},
{'uid': 'pr_3gln76', 'label': '', 'type': 'type', 'field': 'start_date', 'type_param': 'date'}]

 

Best answer by RenatoF

Nevermind, it works through the Explore API v2.1.

View original

1 reply

  • Author
  • Guide
  • Answer
  • Feb 23, 2025 8:35 AM UTC

Nevermind, it works through the Explore API v2.1.

Translate