luigi.contrib.mysqldb module

class luigi.contrib.mysqldb.MySqlTarget(host, database, user, password, table, update_id)[source]

Bases: luigi.target.Target

Target for a resource in MySql.

Initializes a MySqlTarget instance.

Parameters:
  • host (str) – MySql server address. Possibly a host:port string.
  • database (str) – database name.
  • user (str) – database user
  • password (str) – password for specified user.
  • update_id (str) – an identifier for this data set.
marker_table = 'table_updates'
touch(connection=None)[source]

Mark this update as complete.

IMPORTANT, If the marker table doesn’t exist, the connection transaction will be aborted and the connection reset. Then the marker table will be created.

exists(connection=None)[source]
connect(autocommit=False)[source]
create_marker_table()[source]

Create marker table if it doesn’t exist.

Using a separate connection since the transaction might have to be reset.