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

missing pandas when using isinstance #2056

Open
1 task done
vladkolotvin opened this issue Jan 28, 2025 · 3 comments
Open
1 task done

missing pandas when using isinstance #2056

vladkolotvin opened this issue Jan 28, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@vladkolotvin
Copy link

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

Traceback (most recent call last):
2025-01-28T12:19:51.802342624Z   File "/usr/local/lib/python3.12/weakref.py", line 590, in __call__
2025-01-28T12:19:51.802544917Z     return info.func(*info.args, **(info.kwargs or {}))
2025-01-28T12:19:51.802548333Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.802549625Z   File "/usr/src/app/kai/kai/bot/bot.py", line 170, in cleanup
2025-01-28T12:19:51.802550583Z     print(referrers.get_referrer_graph(conversation))
2025-01-28T12:19:51.802551417Z           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.802587458Z   File "/usr/local/lib/python3.12/site-packages/referrers/impl.py", line 162, in get_referrer_graph
2025-01-28T12:19:51.802590083Z     return get_referrer_graph_for_list(
2025-01-28T12:19:51.802590958Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.802591833Z   File "/usr/local/lib/python3.12/site-packages/referrers/impl.py", line 234, in get_referrer_graph_for_list
2025-01-28T12:19:51.802592792Z     builder = _ReferrerGraphBuilder(
2025-01-28T12:19:51.802593583Z               ^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.802594417Z   File "/usr/local/lib/python3.12/site-packages/referrers/impl.py", line 710, in __init__
2025-01-28T12:19:51.802980461Z     self._id_to_enclosing_closure = self._get_closure_functions()
2025-01-28T12:19:51.802985086Z                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.802986169Z   File "/usr/local/lib/python3.12/site-packages/referrers/impl.py", line 1074, in _get_closure_functions
2025-01-28T12:19:51.803291962Z     if inspect.isfunction(possible_function) or inspect.ismethod(
2025-01-28T12:19:51.803297171Z        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.803298921Z   File "/usr/local/lib/python3.12/inspect.py", line 389, in isfunction
2025-01-28T12:19:51.804443843Z     return isinstance(object, types.FunctionType)
2025-01-28T12:19:51.804452010Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.804454218Z   File "/usr/local/lib/python3.12/site-packages/openai/_utils/_proxy.py", line 49, in __class__
2025-01-28T12:19:51.804517219Z     proxied = self.__get_proxied__()
2025-01-28T12:19:51.804519427Z               ^^^^^^^^^^^^^^^^^^^^^^
2025-01-28T12:19:51.804520344Z   File "/usr/local/lib/python3.12/site-packages/openai/_utils/_proxy.py", line 55, in __get_proxied__
2025-01-28T12:19:51.804563511Z     return self.__load__()
2025-01-28T12:19:51.804565469Z            ^^^^^^^^^^^^^^^
2025-01-28T12:19:51.804568511Z   File "/usr/local/lib/python3.12/site-packages/openai/_extras/pandas_proxy.py", line 22, in __load__
2025-01-28T12:19:51.804681636Z     raise MissingDependencyError(PANDAS_INSTRUCTIONS) from err
2025-01-28T12:19:51.804712678Z openai._extras._common.MissingDependencyError: 
2025-01-28T12:19:51.804714428Z 
2025-01-28T12:19:51.804715303Z OpenAI error:
2025-01-28T12:19:51.804716178Z 
2025-01-28T12:19:51.804716970Z     missing `pandas`
2025-01-28T12:19:51.804717845Z 
2025-01-28T12:19:51.804718720Z This feature requires additional dependencies:
2025-01-28T12:19:51.804719678Z 
2025-01-28T12:19:51.804720470Z     $ pip install openai[datalib]
2025-01-28T12:19:51.804721345Z 
2025-01-28T12:19:51.804722178Z 

To Reproduce

  1. import openai library
  2. try to use "referrers" libary

Code snippets

OS

macos

Python version

3.12.6

Library version

1.13.3

@vladkolotvin vladkolotvin added the bug Something isn't working label Jan 28, 2025
@vladkolotvin
Copy link
Author

same on version 1.60.2

@vladkolotvin vladkolotvin changed the title missing pandas when using isinstance missing pandas when using isinstance Jan 28, 2025
@RobertCraigie
Copy link
Collaborator

Thanks for the report, is there any way to tell this library to just not inspect certain symbols / paths? This is eagerly importing internal helpers and then trying to inspect them in ways which breaks assumptions about how the helpers should be used.

@vladkolotvin
Copy link
Author

Thanks for the report, is there any way to tell this library to just not inspect certain symbols / paths? This is eagerly importing internal helpers and then trying to inspect them in ways which breaks assumptions about how the helpers should be used.

Hmm, this is a library for memory debugging. I didn't manage to find a way to disable inspecting specific types.

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
None yet
Development

No branches or pull requests

2 participants