Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TripPin.pq #259

Merged
merged 1 commit into from
Nov 19, 2019
Merged

Update TripPin.pq #259

merged 1 commit into from
Nov 19, 2019

Conversation

ryanbooz
Copy link
Contributor

By default, the Table.FromRecords function utilizes the column names from the first record for the remaining records. If that record is missing columns, the rest of the records will be NULL. More problematic, however, is when responses from multiple pages of an API request have different sets of fields. In this case, the paged function doesn't know how to stitch the individual pages back together because they have different column counts. This is not uncommon from APIs that remove NULL values from the response.

Passing the schema columns names into this Table.FromRecords function does prevent the overall flow from being "dynamic", but it prevents errors when responses within a paged route are different. The SchemaTransformTable function can still be used, it's main value being to set column types.

By default, the `Table.FromRecords` function utilizes the column names from the first record for the remaining records. If that record is missing columns, the rest of the records will be NULL.  More problematic, however, is when responses from multiple pages of an API request have different sets of fields.  In this case, the paged function doesn't know how to stitch the individual pages back together because they have different column counts.  This is not uncommon from APIs that remove NULL values from the response.

Passing the schema columns names into this `Table.FromRecords` function does prevent the overall flow from being "dynamic", but it prevents errors when responses within a paged route are different. The `SchemaTransformTable` function can still be used, it's main value being to set column types.
@mattmasson mattmasson merged commit e39857e into microsoft:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants