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

Add an option to run place-name-resolver without GCS access #410

Merged
merged 4 commits into from
Mar 23, 2021

Conversation

pradh
Copy link
Contributor

@pradh pradh commented Mar 23, 2021

Add a --generate_place_id option to produce placeID results instead of DCID.

@pradh pradh requested a review from shifucun March 23, 2021 07:33
@google-cla google-cla bot added the cla: yes label Mar 23, 2021
@pradh pradh requested a review from thejeshgn March 23, 2021 07:33
placeIdToDcid, err := loadPlaceIdToDcidMap(p2d)
if err != nil {
return err
placeId2Dcid := &map[string]string{}
Copy link
Contributor

Choose a reason for hiding this comment

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

map is "pointer" like, can just do "map[string]string{}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So its okay fro loadPlaceIdToDcidMap() to return a map, rather than a map pointer? Wei had in the past suggested passing/returning pointers...

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed all pointers to refs.

@@ -12,12 +12,22 @@ includes local-id references to contained-in places.

For sample input/output CSVs, see the `.csv` files in `place_name_resolver/testdata` directory.

NOTE: If the `--generate_place_id` is set, then in place of DCIDs, Maps placeIDs
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't have too much context for this use, does it mean user could get the place id in batch (would that be a concern..)?

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 is no different than accessing the public Maps API which return place IDs, which is what the tools does, right? The user of the tool anyway needs to provide the Maps API Key.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then that's okay.

Copy link
Contributor Author

@pradh pradh left a comment

Choose a reason for hiding this comment

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

Thanks for the review!

@@ -12,12 +12,22 @@ includes local-id references to contained-in places.

For sample input/output CSVs, see the `.csv` files in `place_name_resolver/testdata` directory.

NOTE: If the `--generate_place_id` is set, then in place of DCIDs, Maps placeIDs
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 is no different than accessing the public Maps API which return place IDs, which is what the tools does, right? The user of the tool anyway needs to provide the Maps API Key.

placeIdToDcid, err := loadPlaceIdToDcidMap(p2d)
if err != nil {
return err
placeId2Dcid := &map[string]string{}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So its okay fro loadPlaceIdToDcidMap() to return a map, rather than a map pointer? Wei had in the past suggested passing/returning pointers...

@@ -12,12 +12,22 @@ includes local-id references to contained-in places.

For sample input/output CSVs, see the `.csv` files in `place_name_resolver/testdata` directory.

NOTE: If the `--generate_place_id` is set, then in place of DCIDs, Maps placeIDs
Copy link
Contributor

Choose a reason for hiding this comment

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

Then that's okay.

placeIdToDcid, err := loadPlaceIdToDcidMap(p2d)
if err != nil {
return err
placeId2Dcid := &map[string]string{}
Copy link
Contributor

Choose a reason for hiding this comment

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

@pradh pradh requested a review from shifucun March 23, 2021 16:51
@pradh pradh merged commit 4bccd9f into datacommonsorg:master Mar 23, 2021
shamimansari1988 pushed a commit to shamimansari1988/data that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants