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

Unhashable type dict #112

Open
anthonymoser opened this issue Mar 7, 2022 · 2 comments
Open

Unhashable type dict #112

anthonymoser opened this issue Mar 7, 2022 · 2 comments

Comments

@anthonymoser
Copy link

When I try to use any of the demos from the census package or the ward walkthrough, for example
test = c.acs5.state(('NAME', 'B25034_010E'), states.MD.fips, year=2010)

I get
TypeError: unhashable type: 'dict'

coming from this line:
return super(ACSClient, self).get(*args, **kwargs)

return super(ACSClient, self).get(*args, **kwargs)

I tried to test to see if it was my VPN causing problems, or my python version, etc. But the issue has remained. Could be something weird about my environment? But if so I don't know what. Thought I should flag in case something changed about the data structure returned by the census api. I was able to get some block level responses, but not tract.

@fgregg
Copy link
Member

fgregg commented Mar 10, 2022

hi @anthonymoser, can't reproduce.

from census import Census
from us import states

c = Census("YOUR_API_KEY")

foo = c.acs5.get(('NAME', 'B25034_010E'),
                 {'for': 'state:{}'.format(states.MD.fips)})

    
test = c.acs5.state(('NAME', 'B25034_010E'), states.MD.fips)

test = c.acs5.state(('NAME', 'B25034_010E'), states.MD.fips, year=2010)

print(test)

this complete code example (with a correct API key) works for me. will it run for you?

@hancush
Copy link
Member

hancush commented Apr 25, 2022

Hi, @anthonymoser – were you using the core Census client, or the extended Census client from the census_area package? If the latter, there was a bug in our implementation of the lru_cache, which was patched in datamade/census_area#13. Want to install the latest version and give your code another try?

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

No branches or pull requests

3 participants