-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to parse .x.["y.z"] notation #1168
Comments
Trials with 2-part ("z.y") versus 3-part ("z.y.x") key
|
The syntax is either
So, you may be wondering: how come |
Great, that completely addresses my question, thank you. Good to close. For the sake of completeness, it looks like the dot must be elided.
|
Yes, that is correct: the dot must be elided. I misspoke in my earlier comment. |
This seems to be a documentation issue. The reference documentation
This appears to be true only if the dot is at the start. There |
I'll agree that it's a documentation issue, but the real issue is that we
may not be properly explaining what the dot is doing there. The dot means
"the input", and then you're indexing with [], so subsequent indexes in a
chain don't need to have a dot, since they're indexing off of the result.
In fact, as you've noticed, using the dot results in a syntax error. :)
…On Thu, May 11, 2017, 07:31 Roger Peppe ***@***.***> wrote:
This seems to be a documentation issue. The reference documentation
describes the operator as .[0] and says:
When the index value is an integer, .[<value>] can index arrays
This appears to be true only if the dot is at the start. There
are no examples of an array index not at the start, and no
indications that I've found that the dot is not allowed in that
case.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1168 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADQ4V0NFWrbe-Lw4XpL8ivJLHBBeqoSWks5r4vGBgaJpZM4I7A3Y>
.
|
My question is: should we add |
This is something I recently ran into, as well. Simplified examples using JQPlay: With dot (syntax error): Without dot (happy): Is this something that there is a concrete reason behind disallowing? Or is it just a limitation of the current implementation? Wording my question another way: Is there any reason that supporting this in the future would be explicitly unwanted? |
@MondayHopscotch There is no limitation of the current implementation that makes this difficult to support. As to reasons not to support this, I don't think there are any, and this is a very very FAQ. This trivial patch adds support for this:
|
@wtlangford any objections to pushing that patch? |
Perhaps the real issue here is that the documentation doesn't explain the grammar clearly. I can't see anything in the documentation that mentions that
AFAICS One other thing: |
There is certainly a bug in the manual...
|
I've pushed 3e0a118 to allow |
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
* build: Get Read the Docs release number from Cargo manifest This avoids hardcoding the release number in the documentation build config, making it easier to bump the version by only modifying the manifest. * build: Require Python 3.11 in Read the Docs configuration Python 3.11 is needed to access tomllib; useful for parsing the Cargo manifest file. * feat: Create branch, bump version and tag in release workflow * feat: Add publish-github job * fix: Broken tag dependencies * chore: Remove enforce-linking-issues workflow * fix: Bump version in pyproject.toml * chore: Upgrade artifact actions from v3 to v4 * fix: Typo in git-commit command * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * Revert "chore: Upgrade artifact actions from v3 to v4" This reverts commit a535971. * fix: Build wheels from release branch * fix: Switch to pypa/gh-action-pypi-publish@release/v1 The older actions doesn't recognize the pyproject.toml metadata fields.
* feat: Store project version in version.txt * fix: Remove cargo-deb metadata section in `zenoh-jni` * feat: Add `bump-and-tag.bash` script * chore: Rename release workflow to pre-release * chore: Disable release event on publish workflows * fix: Typo in ci/scripts * feat: Automate Release * chore: Remove enforce-linking-issues workflow * fix: Set permissions for publishing jobs * feat: Add publish-dokka to release workflow * fix: Set release branch in publishing jobs * fix: Make `branch` input unrequired in publishing jobs * style: Uniformize publishing workflow names * fix: Unecessary use of `BOT_TOKEN_WORKFLOW` * fix: Incorrect Cargo manifest/lockfile path * fix: Add missing `live-run` input for publish-dokka job * fix: Typo in pre-release workflow name * fix: Remove `if: always()` in publish-github job * fix: Remove unecessary SSH passphrase/privatekey inputs * chore: Retrigger CI * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
* build: Get Read the Docs release number from Cargo manifest This avoids hardcoding the release number in the documentation build config, making it easier to bump the version by only modifying the manifest. * build: Require Python 3.11 in Read the Docs configuration Python 3.11 is needed to access tomllib; useful for parsing the Cargo manifest file. * feat: Create branch, bump version and tag in release workflow * feat: Add publish-github job * fix: Broken tag dependencies * chore: Remove enforce-linking-issues workflow * fix: Bump version in pyproject.toml * chore: Upgrade artifact actions from v3 to v4 * fix: Typo in git-commit command * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * Revert "chore: Upgrade artifact actions from v3 to v4" This reverts commit a535971. * fix: Build wheels from release branch * fix: Switch to pypa/gh-action-pypi-publish@release/v1 The older actions doesn't recognize the pyproject.toml metadata fields.
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
* chore: bump pyo3 to 0.21 (#175) Roughly adapt the code to the new PyO3 API, with a few warning fixes. * fix(examples): fix commented parts of z_put.py (#176) * fix(examples): fix commented parts of z_put.py * fix: apply PR reviews * fix: apply PR reviews * Correct the syntax of pyproject.toml (#181) * feat: Automate Release (#165) * build: Get Read the Docs release number from Cargo manifest This avoids hardcoding the release number in the documentation build config, making it easier to bump the version by only modifying the manifest. * build: Require Python 3.11 in Read the Docs configuration Python 3.11 is needed to access tomllib; useful for parsing the Cargo manifest file. * feat: Create branch, bump version and tag in release workflow * feat: Add publish-github job * fix: Broken tag dependencies * chore: Remove enforce-linking-issues workflow * fix: Bump version in pyproject.toml * chore: Upgrade artifact actions from v3 to v4 * fix: Typo in git-commit command * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * Revert "chore: Upgrade artifact actions from v3 to v4" This reverts commit a535971. * fix: Build wheels from release branch * fix: Switch to pypa/gh-action-pypi-publish@release/v1 The older actions doesn't recognize the pyproject.toml metadata fields. * Force sphinx version to 7.2.6 (#185) * fix: Install maturin according to requirements-dev.txt (#186) * fix: fix scout deadlock (#188) Releasing GIL in Scout destructor prevents the deadlock. * fix(uhlc): bump uhlc version (#173) Signed-off-by: gabrik <gabriele.baldoni@gmail.com> Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> * feat(tracing): using zenoh-util function for log initialization (#172) * feat(tracing): using zenoh-util function for log initialization Signed-off-by: gabrik <gabriele.baldoni@gmail.com> * chore: adding Cargo.lock Signed-off-by: gabrik <gabriele.baldoni@gmail.com> * feat(tracing): using zenoh main Signed-off-by: gabrik <gabriele.baldoni@gmail.com> * chore: using new try_init_log_from_env Signed-off-by: gabrik <gabriele.baldoni@gmail.com> * chore: sync Cargo.lock Signed-off-by: gabrik <gabriele.baldoni@gmail.com> --------- Signed-off-by: gabrik <gabriele.baldoni@gmail.com> Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> * feat: add Attachment to API (#189) * feat: add Attachment to API * fix: make attachment a CLI arg in z_put example * Update zenoh/session.py Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> * Apply suggestions from code review Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> * test: add test for attachment --------- Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> * build: Sync with eclipse-zenoh/zenoh@81217c7 from 2024-04-22 (#190) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * fix: Create virtual environment for armv6 build (#191) * build: Sync with eclipse-zenoh/zenoh@2fdddae from 2024-04-23 (#192) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@9a9832a from 2024-04-24 (#193) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@7c64d99 from 2024-04-26 (#194) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@ad58af6 from 2024-04-26 (#195) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#196) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#197) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#198) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#200) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#202) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#203) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * test: add z_ping/z_pong examples (#205) * fix: make attachment API more similar to dict API (#201) * fix: make attachment API more similar to dict API * fix: fix formatting * fix: fix formatting * fix: fix typing * fix: uncomment tests 😅 * docs: add docstring for Attachment * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#206) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * fix: add `Encoding.with_suffix` instead of `Encoding.append` (#208) * fix: add `Encoding.with_suffix` instead of `Encoding.append` * feat: add `prefix`/`suffix` methods to `Encoding` * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#209) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * Support timeout for get in session. Signed-off-by: ChenYing Kuo <evshary@gmail.com> * Update PR based on the review. Signed-off-by: ChenYing Kuo <evshary@gmail.com> * Fix CI lint error. Signed-off-by: ChenYing Kuo <evshary@gmail.com> * Update: PyTypeError => PyValueError Signed-off-by: ChenYing Kuo <evshary@gmail.com> * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#212) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#213) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#214) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#215) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#216) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#217) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * chore: Update artifacts action to v4 (#218) artifacts actions v3 are deprecated * fix: give unique name for artifacts (#220) upload-artifacts/v4 has a breaking change from v3, which requires the artifacts names to be unique. Fix #219 * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#221) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#222) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#223) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * Fix markdown format in README. (#211) Signed-off-by: ChenYing Kuo <evshary@gmail.com> * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#225) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#228) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * Enable releasing from any branch (#227) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#230) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@93f93d2 from 2024-06-17 (#231) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#236) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * fix: remove deprecated maturin arg (#241) See PyO3/maturin#1620, `--universal2` has been deprecated * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#247) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#248) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#252) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#253) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#259) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#261) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#262) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#265) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#268) Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> * chore: remove useless dependencies --------- Signed-off-by: gabrik <gabriele.baldoni@gmail.com> Signed-off-by: ChenYing Kuo <evshary@gmail.com> Co-authored-by: Yuyuan Yuan <az6980522@gmail.com> Co-authored-by: Mahmoud Mazouz <mazouz.mahmoud@outlook.com> Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Gabriele Baldoni <gabrik@users.noreply.github.com> Co-authored-by: Luca Cominardi <luca.cominardi@gmail.com> Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: ChenYing Kuo <evshary@gmail.com> Co-authored-by: kydos <kydos@protonmail.com> Co-authored-by: Diogo Matsubara <diogo.matsubara@pm.me> Co-authored-by: Diogo Matsubara <diogo.matsubara@zettascale.tech>
mcint@work MINGW64 /c/git
The document
The complex key
One naive approach
Solution proposed by the docs
Work-around
Boundaries of quoted key solution
The text was updated successfully, but these errors were encountered: