-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add monitoring missing dependency: pandas #5100
Conversation
(Fixed unit testing for pandas) |
Pandas should probably be an "extras" as was done here: #4354 |
Given that client query will break (Pandas seems to be a hard dependency), can I suggest changes to?
|
It's fine with me if this needs to directly depend on Pandas. Is the query method the most commonly used method here? |
@jonparrott It looks like |
Okay so it's not needed to query, just need to do |
Then extras is probably the best way to go (and add the conditional back on the unit testing). What do you think? |
Added pandas as optional (and documented how to install it). |
monitoring/setup.py
Outdated
@@ -33,6 +33,7 @@ | |||
'google-api-core<2.0.0dev,>=0.1.1', | |||
] | |||
extras = { | |||
'optional': ['pandas>=0.22.0'], |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
**Pandas:** | ||
|
||
Pandas is an optional dependency that is needed if *query.as_dataframe* is used. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
To install pandas package run: | ||
|
||
$ pip install --upgrade .[pandas] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -14,14 +14,13 @@ | |||
|
|||
try: | |||
import pandas | |||
except ImportError: | |||
except ImportError: # pragma: NO COVER |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
HAVE_PANDAS = False | ||
else: | ||
HAVE_PANDAS = True # pragma: NO COVER | ||
else: # pragma: NO COVER |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
self.assertIsNone(dataframe.index.name) | ||
self.assertIsInstance(dataframe.index, pandas.DatetimeIndex) | ||
|
||
|
||
class Test__sorted_resource_labels(unittest.TestCase): | ||
class Test__sorted_resource_labels(unittest.TestCase): # pragma: NO COVER |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
superseded by #5212 |
Add missing pandas dependency as per:
google/cloud/monitoring/_dataframe.py
google/cloud/monitoring/client.py
google/cloud/monitoring/query.py