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

[BUG] Color by dimension showing all points in grey #518

Closed
axiomofjoy opened this issue Apr 5, 2023 · 2 comments
Closed

[BUG] Color by dimension showing all points in grey #518

axiomofjoy opened this issue Apr 5, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@axiomofjoy
Copy link
Contributor

axiomofjoy commented Apr 5, 2023

Describe the bug
Color by dimension

To Reproduce
Navigate to embeddings page, select color by, select a particular dimension.

Expected behavior
I expect the points to be colored not all in grey

Screenshots
Screenshot 2023-04-05 at 7 48 25 AM

Environment (please complete the following information):

  • OS: MacOS
  • Notebook Runtime: Jupyter
  • Browser: Chrome
  • Version: latest main (commit ad7ae87)

Additional context
Jupyter notebook to repro

@axiomofjoy axiomofjoy added the bug Something isn't working label Apr 5, 2023
@axiomofjoy axiomofjoy changed the title [BUG] Color by dimension showing all points in grey (unknown) [BUG] Color by dimension showing all points in grey Apr 5, 2023
@mikeldking
Copy link
Contributor

@axiomofjoy this is a server-side runtime error in the events resolver you wrote. Passing it back to you for analysis.

'model_str_date'

GraphQL request:23:7
22 |     referenceDataset {
23 |       events(eventIds: $referenceEventIds) {
   |       ^
24 |         id
Traceback (most recent call last):
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3803, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'model_str_date'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/graphql/execution/execute.py", line 521, in execute_field
    result = resolve_fn(source, info, **args)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/schema/schema_converter.py", line 519, in _resolver
    return _get_result(_source, strawberry_info, **kwargs)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/schema/schema_converter.py", line 511, in _get_result
    return field.get_result(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/field.py", line 169, in get_result
    return self.base_resolver(*args, **kwargs)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/types/fields/resolver.py", line 186, in __call__
    return self.wrapped_func(*args, **kwargs)
  File "/Users/mikeldking/work/phoenix/src/phoenix/server/api/types/Dataset.py", line 64, in events
    column_indexes = [
  File "/Users/mikeldking/work/phoenix/src/phoenix/server/api/types/Dataset.py", line 65, in <listcomp>
    dataframe.columns.get_loc(name)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
    raise KeyError(key) from err
KeyError: 'model_str_date'
Stack (most recent call last):
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/mikeldking/work/phoenix/src/phoenix/server/main.py", line 86, in <module>
    uvicorn.run(app, port=args.port)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/asyncio/base_events.py", line 600, in run_forever
    self._run_once()
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once
    handle._run()
  File "/Users/mikeldking/.pyenv/versions/3.10.3/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/starlette/middleware/base.py", line 69, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/asgi/__init__.py", line 48, in __call__
    await self.http_handler_class(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/asgi/handlers/http_handler.py", line 50, in handle
    response = await self.get_http_response(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/asgi/handlers/http_handler.py", line 148, in get_http_response
    result = await execute(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/asgi/handlers/http_handler.py", line 201, in execute
    return await self.schema.execute(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/schema/schema.py", line 226, in execute
    result = await execute(
  File "/Users/mikeldking/.virtualenvs/phoenix/lib/python3.10/site-packages/strawberry/schema/execute.py", line 144, in execute
    process_errors(result.errors, execution_context)
    ```

@axiomofjoy
Copy link
Contributor Author

This issue appears to be caused when the two input DataFrames contain differing columns but have the same schema. Should be resolved by #278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants