Title: `count` does not seem to work · Issue #23 · pythonql/pythonql · GitHub
Open Graph Title: `count` does not seem to work · Issue #23 · pythonql/pythonql
X Title: `count` does not seem to work · Issue #23 · pythonql/pythonql
Description: Seems to be an issue with count. This results in Unknown clause encountered res = [ select (letter, lettercount) for letter in "helloworld" count lettercount ] If I then apply this patch, it now parses. diff --git a/pythonql/parser/Pytho...
Open Graph Description: Seems to be an issue with count. This results in Unknown clause encountered res = [ select (letter, lettercount) for letter in "helloworld" count lettercount ] If I then apply this patch, it now pa...
X Description: Seems to be an issue with count. This results in Unknown clause encountered res = [ select (letter, lettercount) for letter in "helloworld" count lettercount ] If I then apply this patch,...
Opengraph URL: https://github.com/pythonql/pythonql/issues/23
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`count` does not seem to work","articleBody":"Seems to be an issue with `count`. This results in `Unknown clause encountered`\r\n```python\r\nres = [ select (letter, lettercount)\r\n for letter in \"helloworld\"\r\n count lettercount\r\n ]\r\n```\r\nIf I then apply this patch, it now parses.\r\n```diff\r\ndiff --git a/pythonql/parser/PythonQLParser.py b/pythonql/parser/PythonQLParser.py\r\nindex fb8d304..003f4bd 100644\r\n--- a/pythonql/parser/PythonQLParser.py\r\n+++ b/pythonql/parser/PythonQLParser.py\r\n@@ -835,7 +835,7 @@ class Parser:\r\n\r\n def p_count_clause(self, p):\r\n \"\"\"count_clause : COUNT NAME\"\"\"\r\n- p[0] = make_node('count', p)\r\n+ p[0] = make_node('count_clause', p)\r\n\r\n def p_testseq_query(self, p):\r\n \"\"\"testseq_query : test_as_list comma_opt\r\n```\r\nWith results:\r\n```python\r\n[{\"letter\":'h',\"lettercount\":0}, {\"letter\":'e',\"lettercount\":1}, {\"letter\":'l',\"lettercount\":2}, {\"letter\":'l',\"lettercount\":3}, {\"letter\":'o',\"lettercount\":4}, {\"letter\":'w',\"lettercount\":5}, {\"letter\":'o',\"lettercount\":6}, {\"letter\":'r',\"lettercount\":7}, {\"letter\":'l',\"lettercount\":8}, {\"letter\":'d',\"lettercount\":9}]\r\n```","author":{"url":"https://github.com/rectalogic","@type":"Person","name":"rectalogic"},"datePublished":"2022-04-22T20:14:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/23/pythonql/issues/23"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2cdceeb4-dc6f-0c1e-2428-f8f619d90717 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7B4:EA4D:AB4C0:E966E:6981D0C0 |
| html-safe-nonce | 1786f3486e24cc30f21d0b7ac27bd579fd4442abe912761df73a236ebf715b60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0I0OkVBNEQ6QUI0QzA6RTk2NkU6Njk4MUQwQzAiLCJ2aXNpdG9yX2lkIjoiMTcxOTE0ODM4MTE1NzMzNjk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f094877117d616c2ecf9ee59ada904e8e21f369fa1d5635c638b28d4ac517d50 |
| hovercard-subject-tag | issue:1212736056 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonql/pythonql/23/issue_layout |
| twitter:image | https://opengraph.githubassets.com/042ec0607b732d86cdf4eb42601fba31d508290e2da318e32917515c8d117817/pythonql/pythonql/issues/23 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/042ec0607b732d86cdf4eb42601fba31d508290e2da318e32917515c8d117817/pythonql/pythonql/issues/23 |
| og:image:alt | Seems to be an issue with count. This results in Unknown clause encountered res = [ select (letter, lettercount) for letter in "helloworld" count lettercount ] If I then apply this patch, it now pa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rectalogic |
| hostname | github.com |
| expected-hostname | github.com |
| None | ebfdf8d3e0fd17b103f41cc6696d84938694ebebdfecaf11fe00dbe4a9785801 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonql/pythonql git https://github.com/pythonql/pythonql.git |
| octolytics-dimension-user_id | 22842849 |
| octolytics-dimension-user_login | pythonql |
| octolytics-dimension-repository_id | 58056458 |
| octolytics-dimension-repository_nwo | pythonql/pythonql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 58056458 |
| octolytics-dimension-repository_network_root_nwo | pythonql/pythonql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac96edcf00b294dfaa8f1b86d06a198589e60041 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width