Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
81d50cd3
Commit
81d50cd3
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
backwards compatibility, 2.17.1
parent
f4abdfaf
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/opentracing/trace.py
+8
-1
8 additions, 1 deletion
satella/opentracing/trace.py
tests/test_opentracing.py
+4
-2
4 additions, 2 deletions
tests/test_opentracing.py
with
16 additions
and
4 deletions
CHANGELOG.md
+
3
−
0
View file @
81d50cd3
# v2.17.1
*
add backwards compatibility for tags_factory
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
81d50cd3
__version__
=
'
2.17.1
a1
'
__version__
=
'
2.17.1
'
This diff is collapsed.
Click to expand it.
satella/opentracing/trace.py
+
8
−
1
View file @
81d50cd3
...
...
@@ -52,7 +52,14 @@ def trace_function(tracer, name: str, tags: tp.Optional[dict] = None,
tags
=
{}
my_tags
=
copy
.
copy
(
tags
)
for
key
,
value
in
tags_factory
:
my_tags
[
key
]
=
value
(
*
args
,
**
kwargs
)
try
:
v
=
value
(
*
args
,
**
kwargs
)
except
TypeError
:
warnings
.
warn
(
'
You are using the deprecated single-parameter version
'
'
of tags_factory. Please upgrade to the newer one.
'
,
DeprecationWarning
)
v
=
value
(
args
)
my_tags
[
key
]
=
v
with
tracer
.
start_active_span
(
name
,
tags
=
my_tags
):
return
fun
(
*
args
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_opentracing.py
+
4
−
2
View file @
81d50cd3
...
...
@@ -14,7 +14,7 @@ class TestOpentracing(unittest.TestCase):
self
.
start_active_span_called
=
True
def
start_active_span
(
self
,
*
args
,
tags
=
None
,
**
kwargs
):
slf
.
assertEqual
(
tags
,
{
'
a
'
:
'
b
'
,
'
c
'
:
'
d
'
})
slf
.
assertEqual
(
tags
,
{
'
a
'
:
'
b
'
,
'
c
'
:
'
d
'
,
'
e
'
:
'
f
'
})
class
MockScope
(
mock
.
Mock
):
def
__enter__
(
self
):
...
...
@@ -28,7 +28,9 @@ class TestOpentracing(unittest.TestCase):
tracer
=
MockTracer
()
@trace_function
(
tracer
,
'
trace_me
'
,
tags_factory
=
{(
'
a
'
,
lambda
:
'
b
'
),
(
'
c
'
,
lambda
:
'
d
'
)})
tags_factory
=
{
'
a
'
:
lambda
:
'
b
'
,
'
c
'
:
lambda
:
'
d
'
,
'
e
'
:
(
lambda
args
:
'
f
'
)})
def
trace_me
():
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment