civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

[CIVP-19296] Update Python Client to use CSVImports #328

Closed zacharydfriedlander closed 5 years ago

zacharydfriedlander commented 5 years ago

In this PR:

elsander commented 5 years ago

@zacharydfriedlander, can you pull in @leeacto for review as well?

Also tagging @patr1ckm for viz.

zacharydfriedlander commented 5 years ago

If y'all have any questions about the overall functionality of the imports/files/csv endpoint, these Zendesk docs might be helpful - should probably have included these from the outset!

zacharydfriedlander commented 5 years ago

I think this is ready for another round of review!

zacharydfriedlander commented 5 years ago

In manual testing, we discovered an issue with SQL types of different precisions being incorrectly rejected, e.g. VARCHAR(42) and VARCHAR(32) are rejected even though both are VARCHARs. The fix will be two-fold:

  1. Add an option to loosen types as we do in AutoImports to CSVImports - that will require Platform side changes.
  2. Loosen the strictness with which types are checked client-side. Rather than comparing types for string equality, we can look at just the base type.

Just wanted to give everyone a heads up here - I have opened a PR in my fork to address point 2, and will update as work progresses.

zacharydfriedlander commented 5 years ago

After a number of other things arose, I've finally been able to get back to this - the necessary Platform side changes have been made, and I have updated civis_file_to_table to leverage the new parameter added.

You can see a sample import produced by the new code here.