Skip to content

Releases: BritishGeologicalSurvey/etlhelper

v0.9.2

09 Sep 14:16
Compare
Choose a tag to compare

This minor release improves error messages related to DbParams and connections.

  • Creating DbParams for database type with no installed driver raises a Warning
  • Connecting to database with no installed driver raises ETLHelperConnectionError
  • Stack trace for non-existent dbtype error simplified
  • sys.exit(1) / SystemExit calls replaced with ETLHelper errors
  • All print statements replaced with logging calls - this keeps stdout clean

v0.9.1

26 Aug 15:22
1fa33a5
Compare
Choose a tag to compare
  • Fix typo in ETL script template
  • Add .dockerignore (thanks @kinow)
  • Fix typos in docstrings (thanks @kinow)

v0.9.0

26 Aug 08:51
8afd750
Compare
Choose a tag to compare

Breaking changes

Refactored setup_oracle_client

The setup_oracle_client script has been overhauled and the internal logic has been simplified. Externally facing changes are:

  1. The Instant Client zip file is downloaded from the Oracle servers by default (previously it was only accessible to logged in users)
  2. The script writes a file that can run with the source command to add the drivers to LD_LIBRARY_PATH
  3. The client can now be installed and configured in one line: source $(setup_oracle_client)
  4. The --zip_location allows an alternative location (URL or file path) to be specified for the drivers
  5. The --reinstall flag allows reinstallation of an existing install
  6. The -v flag gives verbose output of install progress

Note that in Dockerfiles, it is still necessary to manually set the LD_LIBRARY_PATH using the ENV command.

rowfactory -> row_factory

namedtuple_rowfactory and dict_rowfactory have been replaced with namedtuple_row_factory and dict_row_factory. This makes etlhelper consistent with row_factory in other Python modules e.g. sqlite3 in the standard library.

executemany parameter order changed

The syntax for executemany has been changed from executemany(query, rows, conn) to executemany(query, conn, rows). This is consistent with the other ETL functions where query and conn are together.

Non-breaking changes

  • Update README. New text brings intended use cases and simple example closer to the top.
  • DbParams class gets MY_DB.connect() syntax for creating databases.
  • Add paramstyle attribute to DbHelper class. This allows the required paramstyle to be displayed in error messages, giving users a clue if a syntax error is because they used %s instead of :1 as a placeholder for parameter values.
  • Add integration tests for MS SQL Server databases. These run internally on the BGS CI system.
  • The PostgreSQL DbHelper now catches InterfaceError and InternalError (thanks @rwolniak)

v0.8.0

18 Jun 15:54
c721acb
Compare
Choose a tag to compare
  • Added support for fetchone row. Fetches a single row.
  • Deprecation warning for executemany parameter order. The order of parameters to copyrows will be changed in the next release, or keyword arguments will be used (See: #28)
  • Copy function added to DbParams returning a deep copy.
  • Minor fixes and typos in setup

Contributors @volcan01010 @kerberpolis @metazool @dvalters

v0.7.2

09 Dec 17:51
a18bb66
Compare
Choose a tag to compare
  • Rename sql_server to mssql (#5)
  • Add Python 3.8 to Travis (#20)
  • CI fixes (fix Docker version, pytest deprecation warning fixes)
  • DbParams raises AttributeError on bad key

v0.7.1

22 Nov 10:05
9487378
Compare
Choose a tag to compare
  • Update CI to allow push-button releases

v0.7.0

04 Nov 18:22
e3ad71b
Compare
Choose a tag to compare
  • More examples in README
  • Added logging functionality

v0.6.0

22 Oct 10:33
bd54a57
Compare
Choose a tag to compare
  • Add SQLite helper
  • Improve definition of DbParams via environment variables

v0.5.5

27 Sep 15:01
Compare
Choose a tag to compare
  • Add DbParams parameter validation
  • Make iter_chunks return chunks as generators
  • Add Oracle integration tests
  • Add FOSS4G links to README
  • Update CONTRIBUTING