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

Sam/json csv config #54

Merged
merged 9 commits into from
May 2, 2019
Merged

Sam/json csv config #54

merged 9 commits into from
May 2, 2019

Conversation

sam-fs
Copy link
Contributor

@sam-fs sam-fs commented Apr 30, 2019

SaveAsJson is now a global config variable.

Changed example-config.toml default settings to CSV format, local storage, and GCS only so that a user has more and easier paths to a valid config.

Next step is adding checks and outputing appropriate error messages to the log so that the users can fix their config, but submitting this PR now to get quick fixes published while resolving some cloud credentialing issues.

Copy link
Contributor

@butanian butanian left a comment

Choose a reason for hiding this comment

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

I feel like the example config should propagate the data all the way to redshift/bq.

Is moving the json format option to the global scope a time sensitive issue? Was the motivation to support uploading json file to s3/gcs? Just wondering if we would be better off including config file validation in the same PR.

@@ -33,7 +34,8 @@ DatabaseSchema = "public"

[gcs]
Bucket = "<your bucket>"
GCSOnly = false
# upload data file only (i.e. skip load to BigQuery)?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove the trailing ? here and also in the above the S3Only property

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The motivation was that the “default” config that existed didn't work. SaveAsJson=true was set in [local] in the .toml and that was incompatible with Warehouse="redshift". A user had to set SaveAsJson=true in [local] in order to get CSVs for loading into Redshift (or BigQuery), which wasn't immediately obvious to new users. Also, choosing JSON/CSV makes more sense as a global config b/c someone could want to upload JSON to S3 or GCS, not just download JSONs to local storage.

https://app.clubhouse.io/fullstory/story/62084/make-hauser-smarter-about-json-vs-csv

Looks like the CI checks failed due to GO1.11 config issue. Not sure what that's about.

Copy link
Contributor

Choose a reason for hiding this comment

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

To fix the problem, is it possible to only be sensitive to conf.Local.SaveAsJson if the selected warehouse is local?

My reasoning is that a global save as json flag implies, we create and upload json file, and then also support loading that format into bq and redshift, which we currently don't do. Thoughts?

@sam-fs
Copy link
Contributor Author

sam-fs commented May 1, 2019 via email

@butanian
Copy link
Contributor

butanian commented May 1, 2019

SGTM

the travis error was due to checkgofmt not being happy (probably spaces vs. tab on the line added in config.go). Did gofmt -s -w config/config.go to generate the commit I pushed.

@sam-fs
Copy link
Contributor Author

sam-fs commented May 1, 2019 via email

@sam-fs
Copy link
Contributor Author

sam-fs commented May 2, 2019

This latest travis error may be due to main.go formatting. I've run gofmt -s -w on the file.

Copy link
Contributor

@jameremo jameremo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this work. We should look into setting up our IDEs or pre-commit hooks that run gofmt prior to commit, else we're all going to be super annoyed fixing builds that fail due to formatting. I'll follow up on that.

Also, cc @camphillips22, since he was doing some rearchitecting on hauser and will likely want to make sure this tweak gets incorporated in his branch.

@sam-fs sam-fs merged commit 4ebf3a5 into master May 2, 2019
@sam-fs sam-fs deleted the sam/json-csv-config branch May 2, 2019 16:01
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.

3 participants