Skip to content

Conversation

@ElliottKasoar
Copy link
Owner

No description provided.

@ElliottKasoar ElliottKasoar requested a review from oerc0122 May 2, 2024 13:18
abcd/__init__.py Outdated

db = r.path.split('/')[1] if r.path else None
db = db if db else 'abcd'
db = r.path.split("/")[1] if r.path else None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was there before but does this want to be a pathlib.Path instead?

Not sure if this is necessarily safe just taking the first element, but then again, I'm not 100% what "path" is a path to or contains.

It will also fail if r.path doesn't contain "/", e.g. winpath with "\"

abcd/__init__.py Outdated
db = r.path.split('/')[1] if r.path else None
db = db if db else 'abcd'
db = r.path.split("/")[1] if r.path else None
db = db if db else "abcd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary given it's just been assigned to None above, would

db = pth if r.path and (pth := r.path.split("/")[1]) else "abcd"

be clearer? Not sure.

N.B. Python 3.8+

@ElliottKasoar ElliottKasoar force-pushed the add_opensearch branch 18 times, most recently from 8e4036d to 0e30256 Compare June 12, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants