Skip to content
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

invalid literal for int() in resolve_pinpoint_to_row #847

Open
hyanwong opened this issue May 4, 2024 · 2 comments
Open

invalid literal for int() in resolve_pinpoint_to_row #847

hyanwong opened this issue May 4, 2024 · 2 comments

Comments

@hyanwong
Copy link
Member

hyanwong commented May 4, 2024

I'm seeing this in the logs:

<class 'ValueError'> invalid literal for int() with base 10: 'Melainabacteria_group=5268478'
Traceback (most recent call last):
  File "/usr/home/web2py/www.onezoom.org/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/compiled/controllers.API.pinpoints.py", line 896, in <module>
  File "/usr/home/web2py/www.onezoom.org/gluon/globals.py", line 463, in <lambda>
    self._caller = lambda f: f()
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/compiled/controllers.API.pinpoints.py", line 148, in pinpoints
  File "/usr/home/web2py/www.onezoom.org/applications/OZtree/modules/pinpoint.py", line 61, in resolve_pinpoint_to_row
    node_query = db.ordered_nodes.ott == int(pinpoint)
@davidebbo
Copy link
Contributor

5268478 is Cyanobacteria/Melainabacteria group. Initial thought is that the slash in the pseudo-taxon is throwing something off.

In the newick, it looks like 'Cyanobacteria/Melainabacteria_group_ott5268478'.

That being said, there are quite a few entries with a /, so maybe there is more to it.

@lentinj
Copy link
Collaborator

lentinj commented May 7, 2024

The slash is a very good point. A URL like https://beta.onezoom.org/API/pinpoints.json/@Cyanobacteria/Melainabacteria_group=5268478 goes bang in the way you'd expect. We try and treat each half as a pinpoint, and the latter half doesn't look like a valid OTT:

elif not pinpoint.startswith('@'):
# Doesn't start with @? Treat as OTT
node_query = db.ordered_nodes.ott == int(pinpoint)
leaf_query = db.ordered_leaves.ott == int(pinpoint)

There's not that much that can be done within the API. The damage is done by this point, so we'd need to figure out what's calling it with a malformed URL.

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

No branches or pull requests

3 participants