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

Fvk socrata tweaks #1344

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Fvk socrata tweaks #1344

wants to merge 6 commits into from

Conversation

fvankrieken
Copy link
Contributor

@fvankrieken fvankrieken commented Dec 23, 2024

@alexrichey - tried to keep things pretty 1-1 with existing code for now.

See https://data.cityofnewyork.us/City-Government/2010-Census-Blocks-water-areas-included-/jyp7-eqhh/revisions/44 - metadata being applied correctly

This isn't quite right yet. there are some default transformations

@fvankrieken fvankrieken force-pushed the fvk-socrata-tweaks branch 2 times, most recently from 840743c to c659320 Compare December 23, 2024 18:47
)
if our_col.custom and our_col.custom.get("api_name"):
logger.info(f"Mapping column {our_col.id} to {col}")
output_schema.change_column_transform(col).to(f"`{our_col.id}`")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably should be our_col.name.lower() rather than our_col.id - as far as I can tell, that's how socrata reads in the datasets

@@ -594,6 +593,7 @@ def push_dataset(
for attachment_id in socrata_dest.attachment_ids
]

dataset.discard_open_revisions()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should remember to take this out 🙂

output_schema.change_column_metadata(field_name, "position").to(
our_col_index + 1
)
# .change_column_metadata(col, "initial_output_column_id").to(col.id)
Copy link
Contributor Author

@fvankrieken fvankrieken Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left this as a comment but seems like this is handled under the hood when using the socratapy methods

@alexrichey alexrichey force-pushed the ar-socrata-bytes-gha branch 3 times, most recently from dd3a0ab to a7a8f89 Compare December 30, 2024 21:36
Base automatically changed from ar-socrata-bytes-gha to main December 31, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

1 participant