Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
Importing google.datalab.kernel is working
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjbauer committed Aug 14, 2018
1 parent a886276 commit 2e98c02
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion google/datalab/stackdriver/monitoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

from __future__ import absolute_import

from google.cloud.monitoring import Aligner, Reducer
from google.cloud.monitoring import enums

Aligner = enums.Aggregation.Aligner
Reducer = enums.Aggregation.Reducer

from ._group import Groups
from ._metric import MetricDescriptors
from ._query import Query
Expand Down
12 changes: 6 additions & 6 deletions google/datalab/stackdriver/monitoring/_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

from __future__ import absolute_import

import google.cloud.monitoring
import google.cloud.monitoring_v3.query

from . import _query_metadata
from . import _utils


class Query(google.cloud.monitoring.Query):
class Query(google.cloud.monitoring_v3.query.Query):
"""Query object for retrieving metric data."""

def __init__(self,
metric_type=google.cloud.monitoring.Query.DEFAULT_METRIC_TYPE,
metric_type=google.cloud.monitoring_v3.query.Query.DEFAULT_METRIC_TYPE,
end_time=None, days=0, hours=0, minutes=0, context=None):
"""Initializes the core query parameters.
Expand All @@ -33,13 +33,13 @@ def __init__(self,
the resulting duration from the end time.
It is also allowed to omit the end time and duration here,
in which case :meth:`~google.cloud.monitoring.query.Query.select_interval`
in which case :meth:`~google.cloud.monitoring_v3.query.Query.select_interval`
must be called before the query is executed.
Args:
metric_type: The metric type name. The default value is
:data:`Query.DEFAULT_METRIC_TYPE
<google.cloud.monitoring.query.Query.DEFAULT_METRIC_TYPE>`, but
<google.cloud.monitoring_v3.query.Query.DEFAULT_METRIC_TYPE>`, but
please note that this default value is provided only for
demonstration purposes and is subject to change.
end_time: The end time (inclusive) of the time interval for which
Expand All @@ -54,7 +54,7 @@ def __init__(self,
ValueError: ``end_time`` was specified but ``days``, ``hours``, and
``minutes`` are all zero. If you really want to specify a point in
time, use
:meth:`~google.cloud.monitoring.query.Query.select_interval`.
:meth:`~google.cloud.monitoring_v3.query.Query.select_interval`.
"""
client = _utils.make_client(context)
super(Query, self).__init__(client, metric_type,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
'configparser>=3.5.0',
'mock>=2.0.0',
'future>=0.16.0',
'google-cloud>=0.30.0',
'google-cloud-monitoring>=0.30.1',
'google-api-python-client>=1.6.2',
'seaborn>=0.7.0',
'plotly>=1.12.5',
Expand Down

0 comments on commit 2e98c02

Please sign in to comment.