René's URL Explorer Experiment


Title: Easy way to unmarshall/dump objects to Json? · Issue #298 · googleapis/python-bigquery · GitHub

Open Graph Title: Easy way to unmarshall/dump objects to Json? · Issue #298 · googleapis/python-bigquery

X Title: Easy way to unmarshall/dump objects to Json? · Issue #298 · googleapis/python-bigquery

Description: Sorry if I missed it, but could not find it in the documentation or after playing around. Basically I am trying to get the raw json dump of objects like Tables or TableList, but via the API we are getting many composed objects that need ...

Open Graph Description: Sorry if I missed it, but could not find it in the documentation or after playing around. Basically I am trying to get the raw json dump of objects like Tables or TableList, but via the API we are ...

X Description: Sorry if I missed it, but could not find it in the documentation or after playing around. Basically I am trying to get the raw json dump of objects like Tables or TableList, but via the API we are ...

Opengraph URL: https://github.com/googleapis/python-bigquery/issues/298

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Easy way to unmarshall/dump objects to Json?","articleBody":"Sorry if I missed it, but could not find it in the documentation or after playing around. \r\n\r\nBasically I am trying to get the raw json dump of objects like Tables or [TableList](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list#response-body), but via the API we are getting many composed objects that need to be unmarshalled manually one by one.\r\n\r\nFor example: what would be a way to dump into json a TableList? Thanks!\r\n\r\n```\r\nfrom google.cloud import bigquery\r\nimport json\r\n\r\nclient = bigquery.Client()                \r\n                \r\nfor d in client.list_datasets():\r\n  for t in client.list_tables(d.reference):\r\n    print(t)\r\n    print(repr(t))\r\n    print(dir(t))\r\n    print(t.table_id)\r\n    print(json.dumps(t))\r\n```\r\n    \r\n    \r\n```\r\n\u003cgoogle.cloud.bigquery.table.TableListItem object at 0x7f02c30b0760\u003e\r\n\u003cgoogle.cloud.bigquery.table.TableListItem object at 0x7f02c30b0760\u003e\r\n['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_properties', 'clustering_fields', 'created', 'dataset_id', 'expires', 'friendly_name', 'from_string', 'full_table_id', 'labels', 'partition_expiration', 'partitioning_type', 'project', 'reference', 'table_id', 'table_type', 'time_partitioning', 'to_bqstorage', 'view_use_legacy_sql']\r\narr\r\nTraceback (most recent call last):\r\n  File \"\u003cstdin\u003e\", line 7, in \u003cmodule\u003e\r\n  File \"/usr/lib/python3.8/json/__init__.py\", line 231, in dumps\r\n    return _default_encoder.encode(obj)\r\n  File \"/usr/lib/python3.8/json/encoder.py\", line 199, in encode\r\n    chunks = self.iterencode(o, _one_shot=True)\r\n  File \"/usr/lib/python3.8/json/encoder.py\", line 257, in iterencode\r\n    return _iterencode(o, 0)\r\n  File \"/usr/lib/python3.8/json/encoder.py\", line 179, in default\r\n    raise TypeError(f'Object of type {o.__class__.__name__} '\r\nTypeError: Object of type TableListItem is not JSON serializable\r\n    \r\n```\r\n    \r\n--\u003e\r\n\r\n`{\"created\":\"2020-10-05T01:43:40.077Z\",\"dataset_id\":\"d\",\"description\":null, ...}`\r\n","author":{"url":"https://github.com/romainr","@type":"Person","name":"romainr"},"datePublished":"2020-10-05T20:08:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/298/python-bigquery/issues/298"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:531c6ea6-4a04-0b06-3a0b-2f13844a15c7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE2DE:383777:2A71634:3A8E7CC:6A4EFE5E
html-safe-nonce2a8943181bd4241475803b81d8c248cac28d721af4a74ca68c59b3b4a71f1542
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkRFOjM4Mzc3NzoyQTcxNjM0OjNBOEU3Q0M6NkE0RUZFNUUiLCJ2aXNpdG9yX2lkIjoiMjAxMTgwODQ3MTg3NjMwNDQ3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc129857ecda4b5664b1a5f3e7a132a8008e11f75180a5f493554ca87015c8593
hovercard-subject-tagissue:715127449
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/googleapis/python-bigquery/298/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d64d907032bbdaefe997729c0c75ef604a927521c821790d5fc3f957daf3ef03/googleapis/python-bigquery/issues/298
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d64d907032bbdaefe997729c0c75ef604a927521c821790d5fc3f957daf3ef03/googleapis/python-bigquery/issues/298
og:image:altSorry if I missed it, but could not find it in the documentation or after playing around. Basically I am trying to get the raw json dump of objects like Tables or TableList, but via the API we are ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameromainr
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
go-importgithub.com/googleapis/python-bigquery git https://github.com/googleapis/python-bigquery.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992475
octolytics-dimension-repository_nwogoogleapis/python-bigquery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992475
octolytics-dimension-repository_network_root_nwogoogleapis/python-bigquery
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
release2b8f23afb982271f1b22258a94aede67a6b77760
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-bigquery/issues/298#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-bigquery%2Fissues%2F298
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/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/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/enterprise/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%2Fgoogleapis%2Fpython-bigquery%2Fissues%2F298
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=googleapis%2Fpython-bigquery
Reloadhttps://github.com/googleapis/python-bigquery/issues/298
Reloadhttps://github.com/googleapis/python-bigquery/issues/298
Reloadhttps://github.com/googleapis/python-bigquery/issues/298
Please reload this pagehttps://github.com/googleapis/python-bigquery/issues/298
googleapis https://github.com/googleapis
python-bigqueryhttps://github.com/googleapis/python-bigquery
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Fork 324 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Star 799 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-bigquery
Code https://github.com/googleapis/python-bigquery
Issues 0 https://github.com/googleapis/python-bigquery/issues
Pull requests 0 https://github.com/googleapis/python-bigquery/pulls
Actions https://github.com/googleapis/python-bigquery/actions
Projects https://github.com/googleapis/python-bigquery/projects
Security and quality 0 https://github.com/googleapis/python-bigquery/security
Insights https://github.com/googleapis/python-bigquery/pulse
Code https://github.com/googleapis/python-bigquery
Issues https://github.com/googleapis/python-bigquery/issues
Pull requests https://github.com/googleapis/python-bigquery/pulls
Actions https://github.com/googleapis/python-bigquery/actions
Projects https://github.com/googleapis/python-bigquery/projects
Security and quality https://github.com/googleapis/python-bigquery/security
Insights https://github.com/googleapis/python-bigquery/pulse
#299https://github.com/googleapis/python-bigquery/pull/299
Easy way to unmarshall/dump objects to Json?https://github.com/googleapis/python-bigquery/issues/298#top
#299https://github.com/googleapis/python-bigquery/pull/299
https://github.com/HemangChothani
api: bigqueryIssues related to the googleapis/python-bigquery API.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22api%3A%20bigquery%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/romainr
romainrhttps://github.com/romainr
on Oct 5, 2020https://github.com/googleapis/python-bigquery/issues/298#issue-715127449
TableListhttps://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list#response-body
HemangChothanihttps://github.com/HemangChothani
api: bigqueryIssues related to the googleapis/python-bigquery API.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22api%3A%20bigquery%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/python-bigquery/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
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.