question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

layout.get(..., extension=bids.layout.Query.ANY) fails

See original GitHub issue

layout.get assumes that the extension filter is a string or list of strings. We need to handle the Query options, as well as None.

~/Projects/bids-standard/pybids/bids/layout/layout.py in get(self, return_type, target, scope, regex_search, absolute_paths, drop_invalid_filters, **filters)
    918         if 'extension' in filters:
    919             exts = listify(filters['extension'])
--> 920             filters['extension'] = [x.lstrip('.') for x in exts]
    921 
    922         if drop_invalid_filters:

~/Projects/bids-standard/pybids/bids/layout/layout.py in <listcomp>(.0)
    918         if 'extension' in filters:
    919             exts = listify(filters['extension'])
--> 920             filters['extension'] = [x.lstrip('.') for x in exts]
    921 
    922         if drop_invalid_filters:

AttributeError: 'Query' object has no attribute 'lstrip'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
tyarkonicommented, May 12, 2020

This is only failing because of a check intended to ensure backwards compatibility with people still using extensions instead of extension. We’re already issuing a warning that extensions goes away in 0.11, so I vote we just wait till 0.11 and this problem will go away by itself as soon as we remove the vestigial code.

1reaction
effigiescommented, May 11, 2020

The use case was determining which entities were used by a dataset.

[ent for ent in list(layout.get_entities(metadata=False))
 if layout.get(**{ent: bids.layout.Query.ANY})]

This failure required:

[ent for ent in list(layout.get_entities(metadata=False))
 if ent == 'extension' or layout.get(**{ent: bids.layout.Query.ANY})]

There might be smarter ways to go about this, but it seems silly for this to be the only entity that can’t take a Query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Many Hair Extensions Do You Need? - NuTress
When we get an enquiry from a new client who has had hair extensions before, we usually ask “Do you know how many...
Read more >
BEEDS | Bank of England
Data submission. The Bank of England Electronic Data Submission (BEEDS) portal is an online application that manages formal regulatory and statistical data ...
Read more >
Inverting the structure–property map of truss metamaterials by ...
We demonstrate the application to patient-specific bone implants matching clinical stiffness data, and we discuss the extension to spatially graded cellular ...
Read more >
Untitled
PR Number Description Application Function 1955423 Cutter compensation produces fragmented arc CAM PLANAR_M... 1975413 Step Translation of surfaces makes discontinuities TRANSLATOR STEP_AP214 2223375 NX8.5 create the...
Read more >
Cisco Unity Connection Provisioning Interface (CUPI) API
Configuring an HTML-Based Notification Template with an HTML ... GET http://<connection-server>/vmrest/users?query=(alias%20startswith%20ab).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found