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

Auto-generated trace library (GAPIC only) #3512

Merged
merged 5 commits into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed trace and trace_span which will be in opencensus repo
  • Loading branch information
liyanhui1228 committed Jul 26, 2017
commit afcaa51452f59e67e9d9357e425e71756319a079
4 changes: 1 addition & 3 deletions trace/google/cloud/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# limitations under the License.

from google.cloud.trace.client import Client
from google.cloud.trace.trace import Trace
from google.cloud.trace.trace_span import TraceSpan


__all__ = ['Client', 'Trace', 'TraceSpan']
__all__ = ['Client']
19 changes: 0 additions & 19 deletions trace/google/cloud/trace/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Client for interacting with the Stackdriver Trace API."""

from google.cloud.trace._gax import make_gax_trace_api
from google.cloud.trace.trace import Trace
from google.cloud.client import ClientWithProject
from google.cloud._helpers import _datetime_to_pb_timestamp

Expand Down Expand Up @@ -50,24 +49,6 @@ def trace_api(self):
self._trace_api = make_gax_trace_api(self)
return self._trace_api

def trace(self, project_id=None, trace_id=None):
"""Initialize a new trace instance.

:type project_id: str
:param project_id: ID of the Cloud project where the trace data
is stored.

:type trace_id: str
:param trace_id: ID of the trace. 32 digits uuid.

:rtype: :class:`~google.cloud.trace.trace.Trace`
:returns: A Trace instance.
"""
if project_id is None:
project_id = self.project

return Trace(client=self, project_id=project_id, trace_id=trace_id)

def patch_traces(self, traces, project_id=None, options=None):
"""Sends new traces to Stackdriver Trace or updates existing traces.

Expand Down
125 changes: 0 additions & 125 deletions trace/google/cloud/trace/trace.py

This file was deleted.

163 changes: 0 additions & 163 deletions trace/google/cloud/trace/trace_span.py

This file was deleted.

4 changes: 2 additions & 2 deletions trace/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def lint(session):
Returns a failure if flake8 finds linting errors or sufficiently
serious code quality issues.
"""
session.interpreter = 'python2.7'
session.interpreter = 'python3.6'
session.install('flake8', *LOCAL_DEPS)
session.install('.')
session.run('flake8', 'google/cloud/trace')
Expand All @@ -73,7 +73,7 @@ def cover(session):
This outputs the coverage report aggregating coverage from the unit
test runs (not system test runs), and then erases coverage data.
"""
session.interpreter = 'python2.7'
session.interpreter = 'python3.6'
session.install('coverage', 'pytest-cov')
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
session.run('coverage', 'erase')
2 changes: 1 addition & 1 deletion trace/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
26 changes: 0 additions & 26 deletions trace/tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,6 @@ def make_api(client_obj):
self.assertIs(api, api_obj)
self.assertEqual(clients, [client])

def test_trace_default(self):
from google.cloud.trace.trace import Trace

trace_id = '5e6e73b4131303cb6f5c9dfbaf104e33'
credentials = _make_credentials()
client = self._make_one(project=self.project, credentials=credentials)
result_trace = client.trace(trace_id=trace_id)

self.assertIsInstance(result_trace, Trace)
self.assertIs(result_trace.client, client)
self.assertEqual(result_trace.project_id, self.project)
self.assertEqual(result_trace.trace_id, trace_id)

def test_trace_explicit(self):
from google.cloud.trace.trace import Trace

trace_id = '5e6e73b4131303cb6f5c9dfbaf104e33'
credentials = _make_credentials()
client = self._make_one(project=self.project, credentials=credentials)
result_trace = client.trace(project_id=self.project, trace_id=trace_id)

self.assertIsInstance(result_trace, Trace)
self.assertIs(result_trace.client, client)
self.assertEqual(result_trace.project_id, self.project)
self.assertEqual(result_trace.trace_id, trace_id)

def test_patch_traces_default(self):
from google.cloud.trace._gax import _TraceAPI

Expand Down
Loading