Skip to content

Injectable statsd client#7138

Merged
xtinec merged 5 commits into
apache:masterfrom
DiggidyDave:injectable-statsd-client
Mar 27, 2019
Merged

Injectable statsd client#7138
xtinec merged 5 commits into
apache:masterfrom
DiggidyDave:injectable-statsd-client

Conversation

@DiggidyDave
Copy link
Copy Markdown
Contributor

@DiggidyDave DiggidyDave commented Mar 26, 2019

Add ability to inject statsd client; some py test/reqs updates

  • Updated the metrics logger to allow construction with an existing statsd
    client, so that it can be configured by external systems or libs.
  • statsd metrics logger also now assumes same defaults as statsd.StatsClient for named
    arguments, which were previously positional/required args
  • added coverage and nose reqs to requirements-dev.txt which are needed to run tests
  • removed dependency on mock lib, it is in python stdlib now
  • updated tox.ini to remove the now-superfluous deps

This commit addresses #7139

Sync with apache/incubator-superset master
merge from apache upstream
- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps
Comment thread tox.ini
deps =
-rrequirements.txt
-rrequirements-dev.txt
coverage
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this was here instead of in requirements-dev.txt where it seems to belong, maybe @john-bodley knows more about this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some context #4552

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think requirements-dev.txt has simply grown to contain more than just the base requirements. If coverage will only be run as part of the CI then it makes sense to have it in tox.ini otherwise requirements-dev.txt makes sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@john-bodley it sounds like you have no objections, and if that's the case I'll leave it in requirements-dev.txt. I like to run unit tests, linter, and codecov quite often in my dev workflow, and its good to have everything in place and low friction for those quick iterative type of flows.

Copy link
Copy Markdown
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 27, 2019

Codecov Report

Merging #7138 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7138      +/-   ##
==========================================
+ Coverage   64.61%   64.63%   +0.02%     
==========================================
  Files         422      422              
  Lines       20605    20607       +2     
  Branches     2253     2253              
==========================================
+ Hits        13313    13320       +7     
+ Misses       7170     7165       -5     
  Partials      122      122
Impacted Files Coverage Δ
superset/stats_logger.py 74.41% <100%> (+13.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 215ed39...d862804. Read the comment docs.

@DiggidyDave
Copy link
Copy Markdown
Contributor Author

@mistercrunch @john-bodley I guess I need a commiter to do the actual merge here. Either of you mind?

@xtinec
Copy link
Copy Markdown
Contributor

xtinec commented Mar 27, 2019

I'll merge it for you @DiggidyDave

@xtinec xtinec merged commit ba19a62 into apache:master Mar 27, 2019
xtinec pushed a commit that referenced this pull request Mar 29, 2019
* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF

(cherry picked from commit ba19a62)
@xtinec xtinec added the lyft Related to Lyft label Mar 29, 2019
xtinec pushed a commit that referenced this pull request Apr 2, 2019
* Sparkline dates aren't formatting in Time Series Table (#6976)

* Exclude venv for python linter to ignore

* Fix NaN error

* Fix the white background shown in SQL editor on drag (#7021)

This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends.

* Show tooltip with time frame (#6979)

* Fix time filter control (#6978)

* Enhancement of query context and object. (#6962)

* added more functionalities for query context and object.

* fixed cache logic

* added default value for groupby

* updated comments and removed print

(cherry picked from commit d5b9795)

* [fix] /superset/slice/id url is too long (#6989)


(cherry picked from commit 6a4d507)

* [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027)


(cherry picked from commit cc58f0e)

* feat: add ability to change font size in big number (#7003)

* Add ability to change font sizes in Big Number

* rename big number to header

* Add comment to clarify font size values

* Allow LIMIT to be specified in parameters (#7052)

* [fix] Cursor jumping when editing chart and dashboard titles (#7038)


(cherry picked from commit fc1770f)

* Changing time table viz to pass formatTime a date (#7020)

(cherry picked from commit 7f3c145)

* [db-engine-spec] Aligning Hive/Presto partition logic (#7007)


(cherry picked from commit 05be866)

* [fix] explore chart from dashboard missed slice title (#7046)


(cherry picked from commit a6d48d4)

* fix inaccurate data calculation with adata rolling and contribution (#7035)


(cherry picked from commit 0782e83)

* Adding warning message for sqllab save query (#7028)


(cherry picked from commit ead3d48)

* [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037)

* Update datasource.py

* Update datasource.py

(cherry picked from commit c771625)

* [csv-upload] Fixing message encoding (#6971)


(cherry picked from commit 48431ab)

* [sql-parse] Fixing LIMIT exceptions (#6963)


(cherry picked from commit 3e076cb)

* Adding custom control overrides (#6956)

* Adding extraOverrides to line chart

* Updating extraOverrides to fit with more cases

* Moving extraOverrides to index.js

* Removing webpack-merge in package.json

* Fixing metrics control clearing metric

(cherry picked from commit e619405)

* [sqlparse] Fixing table name extraction for ill-defined query (#7029)


(cherry picked from commit 07c340c)

* [missing values] Removing replacing missing values (#4905)


(cherry picked from commit 61add60)

* [SQL Lab] Improved query and results tabs rendering reliability (#7082)

closes #7080

(cherry picked from commit 9b58e9f)

* Fix filter_box migration PR #6523 (#7066)

* Fix filter_box migration PR #6523

* Fix druid-related bug

(cherry picked from commit b210742)

* SQL editor layout makeover (#7102)

This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board

(cherry picked from commit 71f1bbd)

* [forms] Fix handling of NULLs

(cherry picked from commit e83a07d)

* handle null column_name in sqla and druid models

(cherry picked from commit 2ff721a)

* Use metric name instead of metric in filter box (#7106)


(cherry picked from commit 003364e)

* Bump python lib croniter to an existing version (#7132)

Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.

This PR bumps to a more recent existing version of the library

(cherry picked from commit 215ed39)

* Revert PR #6933 (#7162)

* [bugfix] SQL Lab 'Filter Results' doesn't stick (#7104)

When using a "Search Results" criteria, the subset of rows that match
the criteria get displayed. While this the filter is applied, if another
query is run, the filter is still active, but not displayed in the input
text box. After this change, the state of the input box sticks after
subsequent queries.

(cherry picked from commit d5e8d66)

* Injectable statsd client (#7138)

* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF

(cherry picked from commit ba19a62)

* [Lyft-GA] Enable color consistency in a dashboard (#7135)

* Enable color consistency in a dashboard

Moved actions, minor UI, allowed dashboard copy

Fix linting errors

Undo unintentional change

Updated and added unit tests

Fail quietly if package has not been updated

Fail quietly on dashboard copy if package is old

* Update packages

* Remove unnecessary code

* Addressed Grace's comments

* Small fix for item key

* Reset chart's color during exploration

* Do not reset chart form data when exploring chart

* Fix double scroll bars when content of sql result table overflows horizontally (#7168)

The PR substracts the scrollbar height from the height of the container of the react virtualized table so we don't see double scrollbars.

(cherry picked from commit 7ffcabd)

* Change number format default

* Use smart formatter instead

* fix merge issues

* Use SMART_NUMBER
xtinec pushed a commit that referenced this pull request Apr 2, 2019
* Sparkline dates aren't formatting in Time Series Table (#6976)

* Exclude venv for python linter to ignore

* Fix NaN error

* Fix the white background shown in SQL editor on drag (#7021)

This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends.

* Show tooltip with time frame (#6979)

* Fix time filter control (#6978)

* Enhancement of query context and object. (#6962)

* added more functionalities for query context and object.

* fixed cache logic

* added default value for groupby

* updated comments and removed print

(cherry picked from commit d5b9795)

* [fix] /superset/slice/id url is too long (#6989)


(cherry picked from commit 6a4d507)

* [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027)


(cherry picked from commit cc58f0e)

* feat: add ability to change font size in big number (#7003)

* Add ability to change font sizes in Big Number

* rename big number to header

* Add comment to clarify font size values

* Allow LIMIT to be specified in parameters (#7052)

* [fix] Cursor jumping when editing chart and dashboard titles (#7038)


(cherry picked from commit fc1770f)

* Changing time table viz to pass formatTime a date (#7020)

(cherry picked from commit 7f3c145)

* [db-engine-spec] Aligning Hive/Presto partition logic (#7007)


(cherry picked from commit 05be866)

* [fix] explore chart from dashboard missed slice title (#7046)


(cherry picked from commit a6d48d4)

* fix inaccurate data calculation with adata rolling and contribution (#7035)


(cherry picked from commit 0782e83)

* Adding warning message for sqllab save query (#7028)


(cherry picked from commit ead3d48)

* [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037)

* Update datasource.py

* Update datasource.py

(cherry picked from commit c771625)

* [csv-upload] Fixing message encoding (#6971)


(cherry picked from commit 48431ab)

* [sql-parse] Fixing LIMIT exceptions (#6963)


(cherry picked from commit 3e076cb)

* Adding custom control overrides (#6956)

* Adding extraOverrides to line chart

* Updating extraOverrides to fit with more cases

* Moving extraOverrides to index.js

* Removing webpack-merge in package.json

* Fixing metrics control clearing metric

(cherry picked from commit e619405)

* [sqlparse] Fixing table name extraction for ill-defined query (#7029)


(cherry picked from commit 07c340c)

* [missing values] Removing replacing missing values (#4905)


(cherry picked from commit 61add60)

* [SQL Lab] Improved query and results tabs rendering reliability (#7082)

closes #7080

(cherry picked from commit 9b58e9f)

* Fix filter_box migration PR #6523 (#7066)

* Fix filter_box migration PR #6523

* Fix druid-related bug

(cherry picked from commit b210742)

* SQL editor layout makeover (#7102)

This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board

(cherry picked from commit 71f1bbd)

* [forms] Fix handling of NULLs

(cherry picked from commit e83a07d)

* handle null column_name in sqla and druid models

(cherry picked from commit 2ff721a)

* Use metric name instead of metric in filter box (#7106)


(cherry picked from commit 003364e)

* Bump python lib croniter to an existing version (#7132)

Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.

This PR bumps to a more recent existing version of the library

(cherry picked from commit 215ed39)

* Revert PR #6933 (#7162)

* [bugfix] SQL Lab 'Filter Results' doesn't stick (#7104)

When using a "Search Results" criteria, the subset of rows that match
the criteria get displayed. While this the filter is applied, if another
query is run, the filter is still active, but not displayed in the input
text box. After this change, the state of the input box sticks after
subsequent queries.

(cherry picked from commit d5e8d66)

* Injectable statsd client (#7138)

* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF

(cherry picked from commit ba19a62)

* [Lyft-GA] Enable color consistency in a dashboard (#7135)

* Enable color consistency in a dashboard

Moved actions, minor UI, allowed dashboard copy

Fix linting errors

Undo unintentional change

Updated and added unit tests

Fail quietly if package has not been updated

Fail quietly on dashboard copy if package is old

* Update packages

* Remove unnecessary code

* Addressed Grace's comments

* Small fix for item key

* Reset chart's color during exploration

* Do not reset chart form data when exploring chart

* Fix double scroll bars when content of sql result table overflows horizontally (#7168)

The PR substracts the scrollbar height from the height of the container of the react virtualized table so we don't see double scrollbars.

(cherry picked from commit 7ffcabd)

* Change number format default

* Use smart formatter instead

* fix merge issues

* Use SMART_NUMBER
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 First shipped in 0.34.0 labels Feb 28, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
* Sparkline dates aren't formatting in Time Series Table (apache#6976)

* Exclude venv for python linter to ignore

* Fix NaN error

* Fix the white background shown in SQL editor on drag (apache#7021)

This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends.

* Show tooltip with time frame (apache#6979)

* Fix time filter control (apache#6978)

* Enhancement of query context and object. (apache#6962)

* added more functionalities for query context and object.

* fixed cache logic

* added default value for groupby

* updated comments and removed print

(cherry picked from commit 326708e)

* [fix] /superset/slice/id url is too long (apache#6989)


(cherry picked from commit e0fea40)

* [WIP] fix user specified JSON metadata not updating dashboard on refresh (apache#7027)


(cherry picked from commit 77d114a)

* feat: add ability to change font size in big number (apache#7003)

* Add ability to change font sizes in Big Number

* rename big number to header

* Add comment to clarify font size values

* Allow LIMIT to be specified in parameters (apache#7052)

* [fix] Cursor jumping when editing chart and dashboard titles (apache#7038)


(cherry picked from commit c697955)

* Changing time table viz to pass formatTime a date (apache#7020)

(cherry picked from commit ada7626)

* [db-engine-spec] Aligning Hive/Presto partition logic (apache#7007)


(cherry picked from commit fafff47)

* [fix] explore chart from dashboard missed slice title (apache#7046)


(cherry picked from commit 908c608)

* fix inaccurate data calculation with adata rolling and contribution (apache#7035)


(cherry picked from commit 7a30ad4)

* Adding warning message for sqllab save query (apache#7028)


(cherry picked from commit ea2ea16)

* [datasource] Ensuring consistent behavior of datasource editing/saving. (apache#7037)

* Update datasource.py

* Update datasource.py

(cherry picked from commit 65a6e40)

* [csv-upload] Fixing message encoding (apache#6971)


(cherry picked from commit 574e213)

* [sql-parse] Fixing LIMIT exceptions (apache#6963)


(cherry picked from commit bf90829)

* Adding custom control overrides (apache#6956)

* Adding extraOverrides to line chart

* Updating extraOverrides to fit with more cases

* Moving extraOverrides to index.js

* Removing webpack-merge in package.json

* Fixing metrics control clearing metric

(cherry picked from commit eb603c7)

* [sqlparse] Fixing table name extraction for ill-defined query (apache#7029)


(cherry picked from commit d0d9cba)

* [missing values] Removing replacing missing values (apache#4905)


(cherry picked from commit ed93b4c)

* [SQL Lab] Improved query and results tabs rendering reliability (apache#7082)

closes apache#7080

(cherry picked from commit 7ee4b18)

* Fix filter_box migration PR apache#6523 (apache#7066)

* Fix filter_box migration PR apache#6523

* Fix druid-related bug

(cherry picked from commit 7063e6c)

* SQL editor layout makeover (apache#7102)

This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board

(cherry picked from commit 62c1a8d)

* [forms] Fix handling of NULLs

(cherry picked from commit e83a07d)

* handle null column_name in sqla and druid models

(cherry picked from commit 2ff721a)

* Use metric name instead of metric in filter box (apache#7106)


(cherry picked from commit 542125b)

* Bump python lib croniter to an existing version (apache#7132)

Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.

This PR bumps to a more recent existing version of the library

(cherry picked from commit d7b90c4)

* Revert PR apache#6933 (apache#7162)

* [bugfix] SQL Lab 'Filter Results' doesn't stick (apache#7104)

When using a "Search Results" criteria, the subset of rows that match
the criteria get displayed. While this the filter is applied, if another
query is run, the filter is still active, but not displayed in the input
text box. After this change, the state of the input box sticks after
subsequent queries.

(cherry picked from commit a50932c)

* Injectable statsd client (apache#7138)

* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF

(cherry picked from commit a326432)

* [Lyft-GA] Enable color consistency in a dashboard (apache#7135)

* Enable color consistency in a dashboard

Moved actions, minor UI, allowed dashboard copy

Fix linting errors

Undo unintentional change

Updated and added unit tests

Fail quietly if package has not been updated

Fail quietly on dashboard copy if package is old

* Update packages

* Remove unnecessary code

* Addressed Grace's comments

* Small fix for item key

* Reset chart's color during exploration

* Do not reset chart form data when exploring chart

* Fix double scroll bars when content of sql result table overflows horizontally (apache#7168)

The PR substracts the scrollbar height from the height of the container of the react virtualized table so we don't see double scrollbars.

(cherry picked from commit 5d6a932)

* Change number format default

* Use smart formatter instead

* fix merge issues

* Use SMART_NUMBER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels lyft Related to Lyft 🚢 0.34.0 First shipped in 0.34.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants