home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1229120653

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/471#issuecomment-1229120653 https://api.github.com/repos/simonw/sqlite-utils/issues/471 1229120653 IC_kwDOCGYnMM5JQuSN 9599 2022-08-27T04:29:49Z 2022-08-27T04:30:03Z OWNER

Found a fix for that!

I replaced this:

python locals = {} globals = {} exec(functions, globals, locals) # Register all callables in the locals dict: for name, value in locals.items(): if callable(value): db.register_function(value, name=name) With this: python globals = {} exec(functions, globals) # Register all callables in the globals dict: for name, value in globals.items(): if callable(value): db.register_function(value, name=name) Because https://docs.python.org/3/library/functions.html#exec says:

If only globals is provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the local variables. If globals and locals are given, they are used for the global and local variables, respectively.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1352932716  
Powered by Datasette · Queries took 1.665ms · About: github-to-sqlite