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

Fix final calls to root logger #205

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

MarvinSchenkel
Copy link
Contributor

@MarvinSchenkel MarvinSchenkel commented Apr 13, 2023

Proposed changes

This PR changes the last calls to the root logger of the logging package. This will make sure only one handler is used when the dbldatagen package is used in downstream projects.

Before

import logging
date_format = "%Y-%m-%d %H:%M:%S"
log_format = "%(asctime)s %(levelname)-8s  %(message)s"
formatter = logging.Formatter(log_format, date_format)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
logger.addHandler(handler)
logger.info("Info message")
# Prints: 2023-03-08 14:18:59 INFO      Info message
from dbldatagen import DataGenerator
# Prints: INFO: Version : VersionInfo(major='0', minor='3', patch='1', release='', build='')
logger.info("Info message")
# Prints:
# 2023-03-08 14:18:59 INFO      Info message
# INFO: Info message

After

import logging
date_format = "%Y-%m-%d %H:%M:%S"
log_format = "%(asctime)s %(levelname)-8s  %(message)s"
formatter = logging.Formatter(log_format, date_format)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
logger.addHandler(handler)
logger.info("Info message")
# Prints: 2023-03-08 14:18:59 INFO      Info message
from dbldatagen import DataGenerator
logger.info("Info message")
# Prints:
# 2023-03-08 14:18:59 INFO      Info message

Types of changes

What types of changes does your code introduce to dbldatagen?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Change to tutorials, tests or examples
  • Non code change (readme, images or other non-code assets)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules
  • Submission does not reduce code coverage numbers
  • Submission does not increase alerts or messages from prospector / lint

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you
did and what alternatives you considered, etc...

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #205 (03580b4) into master (615c56b) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #205   +/-   ##
=======================================
  Coverage   91.90%   91.90%           
=======================================
  Files          22       22           
  Lines        2642     2642           
  Branches      449      449           
=======================================
  Hits         2428     2428           
  Misses        127      127           
  Partials       87       87           
Impacted Files Coverage Δ
dbldatagen/column_generation_spec.py 91.95% <ø> (-0.02%) ⬇️
dbldatagen/_version.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ronanstokes-db ronanstokes-db merged commit b90c15a into databrickslabs:master Apr 13, 2023
4 checks passed
ronanstokes-db pushed a commit that referenced this pull request Feb 17, 2024
ronanstokes-db added a commit that referenced this pull request Feb 22, 2024
* wip

* wip

* changes for release

* example notebook

* updates to handle shared spark session restrictions

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* updates to handle shared sparkSession

* changes per code review

* Doc updates 032223 (#180)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

wip

Doc updates 032523 (#181)

* wip

* documentation updates

Feature build ordering improvements 2 (#189)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* improved build ordering

* improved build ordering

* improved build ordering

* reverted unnecessary changes

* reverted unnecessary changes

* udated ColumnSpecOptions description

Feature consistency fixes (#182)

* fixed use of time strings to allow both  and  etc

* fixed use of time strings to allow both 'seconds' and 'second' etc

* id column fixes

Doc updates 100522 (#119)

* fixed reference to dbx in pull_request_template

* reverted inadvertently changed file

* release 0.2.1

* doc updates

* doc updates

* updates for building docs

* updated public docs

* updated sphinx version

* updated docs

* doc updates

* removed generated docs

* removed changes to non-doc

* reverted inadvertently changed file

* release 0.2.1

* doc updates

doc updates

* tidied up makefile

* added workflow action to update tag 'preview'

* develop branch updates

* revised unit tests to use parameterized approach

* changed utils tests to pytest

* changed changelog format

* changelog changes

* changelog updates from merge

* update to change as a resultt of merge of time fixes

* updates for test speed improvements

* updated tests

* updated tests

* updated tests

* updated tests

* fixed typo

* reverted pytest changes - separate feature

* reverted pytest changes - separate feature

* reverted pytest changes - separate feature

* reverted pytest changes - separate feature

* changed partitioning to run more efficiently on github runner

* changed partitioning to run more efficiently on github runner

* changed partitioning to run more efficiently on github runner

* changed partitioning to run more efficiently on github runner

* changed partitioning to run more efficiently on github runner

* use  as query name for spark instance

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Updates to template text generation for better performance and repeatable text generation

* Updates to template text generation for better performance and repeatable text generation

* reverted unrelated changes

* added further coverage tests and renamed option fromn 'seedColumn' to 'seedColumnName' for clarity

* added further coverage test for 'seedColumnName' property'

* additional test coverage

* updated tests for ILText generation

* updated tests for ILText generation

* merged changes from master

* change to test potential break in build process

* updated build process to explicotly use python 3.8

* added explicit python version setup to build

* changes to build actions

* reverted changes to master + build action changes

* remerged repeatable feature generation

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* changed table formatting in TemplateGenerator doc string

* changed table formatting in TemplateGenerator doc string

* updates from master

* updates to develop

* dont update coverage when pushing to develop

* Feature docs v34 (#197)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* doc changes only

* wip

* wip

* Update generating_column_data.rst

* Update generating_json_data.rst

* wip

* new document build

* adjusted comment banner at start of each doc file

* updated build

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* reverted code comment changes

* merge Feature ordering improvements2 into develop (#198)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* improved build ordering

* improved build ordering

* improved build ordering

* reverted unnecessary changes

* reverted unnecessary changes

* reverted inadvertent merge

* Revert "Merge branch 'develop' into feature_consistency_fixes"

This reverts commit e0efc4e, reversing
changes made to a263bd9.

Feature docs v34 v2 (#192)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* doc changes only

* wip

* wip

* Update generating_column_data.rst

* Update generating_json_data.rst

* wip

* new document build

* adjusted comment banner at start of each doc file

* updated build

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* reverted code comment changes

* wip

* Feature v34 (#201)

* wip

* prep for release

* prep for release

* wip

* Feature generate from existing data (#163)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Remove calls to root logger. (#205)

* Release v34post1 (#206)

* wip

* hotfix release for logger fixes

* fix for root logger configuration

* Fix doc typos and minor clarification (#207)

* wip

* wip

* wip

* Feature issue 209 (#210)

* wip

* wip

* wip

* Release 0v34post2 (#211)

* wip

* wip

* Feature html formatting (#208)

* wip

* wip

* wip

* wip

* wip

* wip

* Build fixes (#213)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* updated build version

* updated build version

* Feature doc change generating text (#218)

* wip

* wip

* wip

* updated running of prospector

* Feature build update (#220)

* wip

* wip

* updates to handle changes in upstream pipenv package

* updated build version

* Feature struct changes (#219)

* wip

* wip

* added support for inferred types

* added support for inferred types

* wip

* wip

* wip

* updates and fixes to unit tests

* wip

* updated pipfile due to upstream changes in pipenv

* additional tests

* wip

* wip

* wip

* wip

* removed old code

* Feature additional docs (#222)

* wip

* wip

* doc updates

* function doc changes only

* function doc changes only

* changes for release

* example notebook

* Feature readme updates - updates readme to note compatible Unity Catalog releases (#236)

* wip

* wip

* changes for release

* example notebook

* updated readme to note compatible unity catalog runtimes

* updated readme to note compatible unity catalog runtimes

* updated readme to note compatible unity catalog runtimes

* updated readme to note compatible unity catalog runtimes

* Feature add codeowners (#238)

* Test assign (#239)

* updates to handle shared spark session restrictions

* Update LICENSE (#246)

* updates to handle shared sparkSession

* changes per code review

---------

Co-authored-by: Marvin Schenkel <marvinschenkel@gmail.com>
Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants