Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions monitoring/google/cloud/monitoring_v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
from google.cloud.monitoring_v3.gapic import enums
from google.cloud.monitoring_v3.gapic import group_service_client
from google.cloud.monitoring_v3.gapic import metric_service_client
from google.cloud.monitoring_v3.gapic import notification_channel_service_client
from google.cloud.monitoring_v3.gapic import \
notification_channel_service_client
from google.cloud.monitoring_v3.gapic import uptime_check_service_client


Expand All @@ -41,7 +42,8 @@ class MetricServiceClient(metric_service_client.MetricServiceClient):

class NotificationChannelServiceClient(
notification_channel_service_client.NotificationChannelServiceClient):
__doc__ = notification_channel_service_client.NotificationChannelServiceClient.__doc__
__doc__ = notification_channel_service_client.\
NotificationChannelServiceClient.__doc__
enums = enums


Expand Down
2 changes: 1 addition & 1 deletion monitoring/google/cloud/monitoring_v3/_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import itertools
try:
import pandas
except ImportError:
except ImportError: # pragma: NO COVER
pandas = None

from google.cloud.monitoring_v3.types import TimeSeries
Expand Down
1 change: 1 addition & 0 deletions monitoring/google/cloud/monitoring_v3/proto/common_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions monitoring/tests/unit/test__dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def test_simple_label(self):
self.assertEqual(dataframe.shape, DIMENSIONS)
self.assertEqual(dataframe.values.tolist(), ARRAY)

self.assertEqual(list(dataframe.columns), INSTANCE_NAMES)
expected_headers = [(instance_name,)
for instance_name in INSTANCE_NAMES]
self.assertEqual(list(dataframe.columns), expected_headers)
self.assertIsNone(dataframe.columns.name)

self.assertEqual(list(dataframe.index), parse_timestamps())
Expand Down Expand Up @@ -138,9 +140,10 @@ def test_multiple_labels_with_just_one(self):
self.assertEqual(dataframe.shape, DIMENSIONS)
self.assertEqual(dataframe.values.tolist(), ARRAY)

self.assertEqual(list(dataframe.columns), INSTANCE_IDS)
expected_headers = [(instance_id,) for instance_id in INSTANCE_IDS]
self.assertEqual(list(dataframe.columns), expected_headers)
self.assertEqual(dataframe.columns.names, NAMES)
self.assertEqual(dataframe.columns.name, NAME)
self.assertIsNone(dataframe.columns.name)

self.assertEqual(list(dataframe.index), parse_timestamps())
self.assertIsNone(dataframe.index.name)
Expand Down Expand Up @@ -189,7 +192,7 @@ def test_empty_table_multiple_labels_with_just_one(self):
dataframe = self._call_fut([], labels=NAMES)
self.assertEqual(dataframe.shape, (0, 0))
self.assertEqual(dataframe.columns.names, NAMES)
self.assertEqual(dataframe.columns.name, NAME)
self.assertIsNone(dataframe.columns.name)
self.assertIsNone(dataframe.index.name)
self.assertIsInstance(dataframe.index, pandas.DatetimeIndex)

Expand All @@ -199,7 +202,7 @@ def test_empty_table_smart_labels(self):
dataframe = self._call_fut([])
self.assertEqual(dataframe.shape, (0, 0))
self.assertEqual(dataframe.columns.names, NAMES)
self.assertEqual(dataframe.columns.name, NAME)
self.assertIsNone(dataframe.columns.name)
self.assertIsNone(dataframe.index.name)
self.assertIsInstance(dataframe.index, pandas.DatetimeIndex)

Expand Down
2 changes: 0 additions & 2 deletions monitoring/tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from __future__ import absolute_import

import copy
import datetime
import unittest
import mock
Expand Down Expand Up @@ -297,7 +296,6 @@ def test_request_parameters_maximal(self):
FIELD1, FIELD2 = 'resource.zone', 'metric.instance_name'

PAGE_SIZE = 100
PAGE_TOKEN = 'second-page-please'

channel = ChannelStub()
client = MetricServiceClient(channel=channel)
Expand Down