Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions docs/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ Getting Started
===============

Pylytics v1.0 is significantly improved from v0.7. New documentation will follow shortly.

.. toctree::
:maxdepth: 2
:numbered:

mysql-configuration
10 changes: 10 additions & 0 deletions docs/getting-started/mysql_configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MySQL Configuration
===================

Pylytics is tested against MySQL 5.5 and 5.6.

If you are running MySQL 5.6, make sure the server is configured as following::

explicit_defaults_for_timestamp=OFF

This is the default setting for MySQL 5.6, however some cloud providers have it set differently.
25 changes: 25 additions & 0 deletions test/unit/library/test_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,28 @@ def test_null_values(self, empty_warehouse, store, null_store):
Store.insert(store)
Store.insert(null_store)
assert self._fetch_store_row_count() == 2


class TestAutoTimeStamp():
"""
The `applicable_from` and `created` columns in the dimension tables default
to the current datetime. This was implemented using triggers. These
tests make sure they're working properly (especially useful for running
these tests across multiple MySQL versions).

"""

def test_success(self, empty_warehouse, store):
""" Just check that applicable_from == created_at.
"""
Warehouse.use(empty_warehouse)
Store.build()
Store.insert(store)
connection = Warehouse.get()
with closing(connection.cursor(dictionary=True)) as cursor:
cursor.execute(
"SELECT applicable_from, created FROM %s" % Store.__tablename__
)
rows = cursor.fetchall()
assert rows[0]['created']
assert rows[0]['created'] == rows[0]['applicable_from']