René's URL Explorer Experiment


Title: Fetch with as_dict=True raises a confusing error when the attribute list is specified. · Issue #391 · datajoint/datajoint-python · GitHub

Open Graph Title: Fetch with as_dict=True raises a confusing error when the attribute list is specified. · Issue #391 · datajoint/datajoint-python

X Title: Fetch with as_dict=True raises a confusing error when the attribute list is specified. · Issue #391 · datajoint/datajoint-python

Description: When using fetch(1), as_dict works only in certain cases. Some examples: In [73]: reso.schema.jobs Out[73]: *table_name *key_hash status error_message user host pid connection_id timestamp key error_stack +------------+ +------------+ +-...

Open Graph Description: When using fetch(1), as_dict works only in certain cases. Some examples: In [73]: reso.schema.jobs Out[73]: *table_name *key_hash status error_message user host pid connection_id timestamp key erro...

X Description: When using fetch(1), as_dict works only in certain cases. Some examples: In [73]: reso.schema.jobs Out[73]: *table_name *key_hash status error_message user host pid connection_id timestamp key erro...

Opengraph URL: https://github.com/datajoint/datajoint-python/issues/391

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fetch with as_dict=True raises a confusing error when the attribute list is specified.","articleBody":"When using fetch(1), as_dict works only in certain cases. Some examples:\r\n\r\n```\r\nIn [73]: reso.schema.jobs\r\nOut[73]: \r\n*table_name    *key_hash      status       error_message  user           host           pid      connection_id  timestamp      key        error_stack   \r\n+------------+ +------------+ +----------+ +------------+ +------------+ +------------+ +------+ +------------+ +------------+ +--------+ +------------+\r\n__segmentation 30fff7922ea185 reserved                    ecobost@10.28. d6f4e9bc8ab8   2482     1221199        2017-11-13 21: \u003cBLOB\u003e     \u003cBLOB\u003e        \r\n (1 tuples)\r\n\r\nIn [74]: reso.schema.jobs.fetch1(as_dict=True)\r\nOut[74]: \r\nOrderedDict([('table_name', '__segmentation'),\r\n             ('key_hash', '30fff7922ea18543ea1f298418673640'),\r\n             ('status', 'reserved'),\r\n             ('key', rec.array([(1, 1, 1, 3, 3, 10577, 1)], \r\n                        dtype=[('scan_idx', 'O'), ('channel', 'O'), ('session', 'O'), ('segmentation_method', 'O'), ('field', 'O'), ('animal_id', 'O'), ('pipe_version', 'O')])),\r\n             ('error_message', ''),\r\n             ('error_stack', None),\r\n             ('user', 'ecobost@10.28.2.115'),\r\n             ('host', 'd6f4e9bc8ab8'),\r\n             ('pid', 2482),\r\n             ('connection_id', 1221199),\r\n             ('timestamp', datetime.datetime(2017, 11, 13, 21, 51, 5))])\r\n\r\nIn [75]: reso.schema.jobs.fetch1('status', 'pid')\r\nOut[75]: ('reserved', 2482)\r\n\r\nIn [76]: reso.schema.jobs.fetch1('status', 'pid', as_dict=True) # does not return a dict\r\nOut[76]: ('reserved', 2482)\r\n\r\nIn [77]: type(_)\r\nOut[77]: tuple\r\n```\r\n\r\nAnd with fetch, it just fails\r\n```\r\nIn [86]: reso.schema.jobs.fetch('status', 'pid')\r\nOut[86]: [array(['reserved'], dtype=object), array([2482])]\r\n\r\nIn [88]: reso.schema.jobs.fetch('status', 'pid', as_dict=True)\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n\u003cipython-input-79-e0ee9a14edc6\u003e in \u003cmodule\u003e()\r\n----\u003e 1 reso.schema.jobs.fetch('status', 'pid', as_dict=True)\r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/fetch.py in __call__(self, *attrs, **kwargs)\r\n    208                 list(to_dicts(result[self._relation.primary_key]))\r\n    209                 if attribute is PRIMARY_KEY else result[attribute]\r\n--\u003e 210                 for attribute in attrs]\r\n    211             ret = return_values[0] if len(attrs) == 1 else return_values\r\n    212 \r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/fetch.py in \u003clistcomp\u003e(.0)\r\n    208                 list(to_dicts(result[self._relation.primary_key]))\r\n    209                 if attribute is PRIMARY_KEY else result[attribute]\r\n--\u003e 210                 for attribute in attrs]\r\n    211             ret = return_values[0] if len(attrs) == 1 else return_values\r\n    212 \r\n\r\nTypeError: list indices must be integers or slices, not str\r\n```","author":{"url":"https://github.com/ecobost","@type":"Person","name":"ecobost"},"datePublished":"2017-11-14T04:42:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/391/datajoint-python/issues/391"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c58d22c5-968e-97aa-35a0-5cda64e9074e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id84D6:3D3A2:9F5678:D735CB:6A4D7141
html-safe-nonce20f0c0ada10d78bff1013d905598c8e84aec9528a79ec566996e3441c35b02eb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEQ2OjNEM0EyOjlGNTY3ODpENzM1Q0I6NkE0RDcxNDEiLCJ2aXNpdG9yX2lkIjoiMTIyOTY2MzQ0OTQ1OTI5MDQzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaceac4f38c86f5904bbc85096a2dcf5dd43d125a3588f1eb0ad2be913ac19cfb6f
hovercard-subject-tagissue:273665914
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/391/issue_layout
twitter:imagehttps://opengraph.githubassets.com/50a70fb0384d935decaca29fe88b0f2336ac7c539c4740ce13bf3f81c1266621/datajoint/datajoint-python/issues/391
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/50a70fb0384d935decaca29fe88b0f2336ac7c539c4740ce13bf3f81c1266621/datajoint/datajoint-python/issues/391
og:image:altWhen using fetch(1), as_dict works only in certain cases. Some examples: In [73]: reso.schema.jobs Out[73]: *table_name *key_hash status error_message user host pid connection_id timestamp key erro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameecobost
hostnamegithub.com
expected-hostnamegithub.com
Nonec78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e
turbo-cache-controlno-preview
go-importgithub.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git
octolytics-dimension-user_id2375501
octolytics-dimension-user_logindatajoint
octolytics-dimension-repository_id5866704
octolytics-dimension-repository_nwodatajoint/datajoint-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id5866704
octolytics-dimension-repository_network_root_nwodatajoint/datajoint-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release399fff412f48461d435721c009efc17ea44be72f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/datajoint/datajoint-python/issues/391#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdatajoint%2Fdatajoint-python%2Fissues%2F391
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdatajoint%2Fdatajoint-python%2Fissues%2F391
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=datajoint%2Fdatajoint-python
Reloadhttps://github.com/datajoint/datajoint-python/issues/391
Reloadhttps://github.com/datajoint/datajoint-python/issues/391
Reloadhttps://github.com/datajoint/datajoint-python/issues/391
Please reload this pagehttps://github.com/datajoint/datajoint-python/issues/391
datajoint https://github.com/datajoint
datajoint-pythonhttps://github.com/datajoint/datajoint-python
Notifications https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Fork 96 https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Star 194 https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Code https://github.com/datajoint/datajoint-python
Issues 7 https://github.com/datajoint/datajoint-python/issues
Pull requests 4 https://github.com/datajoint/datajoint-python/pulls
Discussions https://github.com/datajoint/datajoint-python/discussions
Actions https://github.com/datajoint/datajoint-python/actions
Security and quality 0 https://github.com/datajoint/datajoint-python/security
Insights https://github.com/datajoint/datajoint-python/pulse
Code https://github.com/datajoint/datajoint-python
Issues https://github.com/datajoint/datajoint-python/issues
Pull requests https://github.com/datajoint/datajoint-python/pulls
Discussions https://github.com/datajoint/datajoint-python/discussions
Actions https://github.com/datajoint/datajoint-python/actions
Security and quality https://github.com/datajoint/datajoint-python/security
Insights https://github.com/datajoint/datajoint-python/pulse
Fetch with as_dict=True raises a confusing error when the attribute list is specified.https://github.com/datajoint/datajoint-python/issues/391#top
https://github.com/ecobost
ecobosthttps://github.com/ecobost
on Nov 14, 2017https://github.com/datajoint/datajoint-python/issues/391#issue-273665914
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.