René's URL Explorer Experiment


Title: Run queries concurrently · Issue #19 · stackql/stackqljs · GitHub

Open Graph Title: Run queries concurrently · Issue #19 · stackql/stackqljs

X Title: Run queries concurrently · Issue #19 · stackql/stackqljs

Description: async def executeQueriesAsync(self, queries): """Executes multiple StackQL queries asynchronously using the current StackQL instance. This method utilizes an asyncio event loop to concurrently run a list of provided StackQL queries. Each...

Open Graph Description: async def executeQueriesAsync(self, queries): """Executes multiple StackQL queries asynchronously using the current StackQL instance. This method utilizes an asyncio event loop to concurrently run ...

X Description: async def executeQueriesAsync(self, queries): """Executes multiple StackQL queries asynchronously using the current StackQL instance. This method utilizes an asyncio event loop to co...

Opengraph URL: https://github.com/stackql/stackqljs/issues/19

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Run queries concurrently","articleBody":"```\n\tasync def executeQueriesAsync(self, queries):\n\t\t\"\"\"Executes multiple StackQL queries asynchronously using the current StackQL instance.\n\n\t\tThis method utilizes an asyncio event loop to concurrently run a list of provided \n\t\tStackQL queries. Each query is executed independently, and the combined results of \n\t\tall the queries are returned as a list of JSON objects if 'dict' output mode is selected,\n\t\tor as a concatenated DataFrame if 'pandas' output mode is selected.\n\n\t\tThe order of the results in the returned list or DataFrame may not necessarily \n\t\tcorrespond to the order of the queries in the input list due to the asynchronous nature \n\t\tof execution.\n\n\t\t:param queries: A list of StackQL query strings to be executed concurrently.\n\t\t:type queries: list[str], required\n\t\t:return: A list of results corresponding to each query. Each result is a JSON object or a DataFrame.\n\t\t:rtype: list[dict] or pd.DataFrame\n\t\t:raises ValueError: If method is used in `server_mode` on an unsupported OS (anything other than Linux).\n\t\t:raises ValueError: If an unsupported output mode is selected (anything other than 'dict' or 'pandas').\n\n\t\tExample:\n\t\t\t\u003e\u003e\u003e from pystackql import StackQL\n\t\t\t\u003e\u003e\u003e stackql = StackQL()\t\t\n\t\t\t\u003e\u003e\u003e queries = [\n\t\t\t\u003e\u003e\u003e \\\"\\\"\\\"SELECT '%s' as region, instanceType, COUNT(*) as num_instances \n\t\t\t... FROM aws.ec2.instances \n\t\t\t... WHERE region = '%s' \n\t\t\t... GROUP BY instanceType\\\"\\\"\\\" % (region, region)\n\t\t\t\u003e\u003e\u003e for region in regions ]\n\t\t\t\u003e\u003e\u003e result = stackql.executeQueriesAsync(queries)\n\n\t\tNote:\n\t\t\t- When operating in `server_mode`, this method is not supported.\n\t\t\"\"\"\n\t\tif self.server_mode:\n\t\t\traise ValueError(\"executeQueriesAsync are not supported in sever_mode.\")\n\t\tif self.output not in ['dict', 'pandas']:\n\t\t\traise ValueError(\"executeQueriesAsync supports only 'dict' or 'pandas' output modes.\")\n\t\tasync def main():\n\t\t\twith ThreadPoolExecutor() as executor:\n\t\t\t\t# New connection is created for each query in server_mode, reused otherwise.\n\t\t\t\tnew_connection = self.server_mode\n\t\t\t\t# Gather results from all the async calls.\n\t\t\t\tloop = asyncio.get_event_loop()\n\t\t\t\tfutures = [loop.run_in_executor(executor, self._sync_query, query, new_connection) for query in queries]\n\t\t\t\tresults = await asyncio.gather(*futures)\n\t\t\t# Concatenate DataFrames if output mode is 'pandas'.\n\t\t\tif self.output == 'pandas':\n\t\t\t\treturn pd.concat(results, ignore_index=True)\n\t\t\telse:\n\t\t\t\treturn [item for sublist in results for item in sublist]\n\t\t# Running the async function\n\t\treturn await main()\n```","author":{"url":"https://github.com/yunchengyang515","@type":"Person","name":"yunchengyang515"},"datePublished":"2023-12-09T12:57:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/19/stackqljs/issues/19"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1d25aaf3-2971-2668-50d7-bb6b7298bc5d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id98A8:8AE8C:1CF1B93:2842E17:6A4EC5A4
html-safe-nonce5add5eaaf522a8c999d264ab5f4e589e9984fb860829ef54d955c161dbc49fc9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEE4OjhBRThDOjFDRjFCOTM6Mjg0MkUxNzo2QTRFQzVBNCIsInZpc2l0b3JfaWQiOiI2OTU0OTQ3MzUxNDQzMDY0MjI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac87a1c72a5184497143ab419070a9b249804025413b37c529e3d77b315eb97af8
hovercard-subject-tagissue:2033839899
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/stackql/stackqljs/19/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b5e3225663f500a3452ca543b9de194d921cc70f7e2349439bc3cfa2b204af2e/stackql/stackqljs/issues/19
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b5e3225663f500a3452ca543b9de194d921cc70f7e2349439bc3cfa2b204af2e/stackql/stackqljs/issues/19
og:image:altasync def executeQueriesAsync(self, queries): """Executes multiple StackQL queries asynchronously using the current StackQL instance. This method utilizes an asyncio event loop to concurrently run ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyunchengyang515
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
go-importgithub.com/stackql/stackqljs git https://github.com/stackql/stackqljs.git
octolytics-dimension-user_id95105302
octolytics-dimension-user_loginstackql
octolytics-dimension-repository_id711717177
octolytics-dimension-repository_nwostackql/stackqljs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id711717177
octolytics-dimension-repository_network_root_nwostackql/stackqljs
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
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/stackql/stackqljs/issues/19#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackql%2Fstackqljs%2Fissues%2F19
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%2Fstackql%2Fstackqljs%2Fissues%2F19
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=stackql%2Fstackqljs
Reloadhttps://github.com/stackql/stackqljs/issues/19
Reloadhttps://github.com/stackql/stackqljs/issues/19
Reloadhttps://github.com/stackql/stackqljs/issues/19
Please reload this pagehttps://github.com/stackql/stackqljs/issues/19
stackql https://github.com/stackql
stackqljshttps://github.com/stackql/stackqljs
Notifications https://github.com/login?return_to=%2Fstackql%2Fstackqljs
Fork 0 https://github.com/login?return_to=%2Fstackql%2Fstackqljs
Star 2 https://github.com/login?return_to=%2Fstackql%2Fstackqljs
Code https://github.com/stackql/stackqljs
Issues 1 https://github.com/stackql/stackqljs/issues
Pull requests 1 https://github.com/stackql/stackqljs/pulls
Actions https://github.com/stackql/stackqljs/actions
Projects https://github.com/stackql/stackqljs/projects
Security and quality 0 https://github.com/stackql/stackqljs/security
Insights https://github.com/stackql/stackqljs/pulse
Code https://github.com/stackql/stackqljs
Issues https://github.com/stackql/stackqljs/issues
Pull requests https://github.com/stackql/stackqljs/pulls
Actions https://github.com/stackql/stackqljs/actions
Projects https://github.com/stackql/stackqljs/projects
Security and quality https://github.com/stackql/stackqljs/security
Insights https://github.com/stackql/stackqljs/pulse
Run queries concurrentlyhttps://github.com/stackql/stackqljs/issues/19#top
https://github.com/yunchengyang515
v0.0.1https://github.com/stackql/stackqljs/milestone/1
https://github.com/yunchengyang515
yunchengyang515https://github.com/yunchengyang515
on Dec 9, 2023https://github.com/stackql/stackqljs/issues/19#issue-2033839899
yunchengyang515https://github.com/yunchengyang515
v0.0.1https://github.com/stackql/stackqljs/milestone/1
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.