Skip to content

Add get_stats endpoint.#123

Merged
shifucun merged 7 commits intodatacommonsorg:masterfrom
tjann:get-stats-api
Apr 24, 2020
Merged

Add get_stats endpoint.#123
shifucun merged 7 commits intodatacommonsorg:masterfrom
tjann:get-stats-api

Conversation

@tjann
Copy link
Copy Markdown
Contributor

@tjann tjann commented Apr 24, 2020

No description provided.

@tjann tjann requested review from Spaceenter, pradh and shifucun April 24, 2020 20:59
related_places = dc.get_related_places(['geoId/06085'], 'Person', 'count',
'CenusACS5yrSurvey', "measuredValue", {"gender": "Female"})
print(related_places)
# print('Get related places')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this commented?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was broken on current master, I've added a TODO.

Comment thread datacommons/places.py
in `Arkansas <https://browser.datacommons.org/kg?dcid=geoId/05>`_
and `California <https://browser.datacommons.org/kg?dcid=geoId/06>`_.

>>> get_stats(["geoId/05", "geoId/06"], "dc/0hyp6tkn18vcb")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mahesh says the rollout is complete, could you use a human-curated DCID in this example?

(Adding a TODO in this PR is fine, if it needs more work.)

Comment thread datacommons/test/places_test.py Outdated
self.assertDictEqual(bad_dcids_1, {
'geoId/06085': ['geoId/0649670'],
'dc/MadDcid': []
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm puzzled by the checks. Why don't the expected dict contain time-series?

Also s/get_places_in/get_stats/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I prematurely requested your review. Was having trouble testing locally so Bo had me create a PR for test to run on CloudRun, shouldn't have requested, though.

This should be fixed now, but need to see test results.

@shifucun shifucun merged commit d5d312a into datacommonsorg:master Apr 24, 2020
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