ploomber.products.GenericProduct

class ploomber.products.GenericProduct(identifier, client=None)

GenericProduct is used when there is no specific Product implementation. Sometimes it is technically possible to write a Product implementation but if you don’t want to do it you can use this one. Other times is is not possible to provide a concrete Product implementation (e.g. we cannot store arbitrary metadata in a Hive table). GenericProduct works as any other product but its metadata is stored not in the Product itself but in a different backend.

Parameters:
  • identifier (str) – An identifier fot this product, can contain placeholders (e.g. {{placeholder}})

  • client (ploomber.clients.DBAPIClient or SQLAlchemyClient, optional) – The client used to store metadata for this product. Only required if no dag-level client has been declared using dag.clients[class]

Notes

exists does not check for product existence, just checks if metadata exists delete does not perform actual deletion, just deletes metadata

Methods

delete([force])

Deletes the product

download()

exists()

This method returns True if the product exists, it is not part of the metadata, so there is no cached status

fetch_metadata()

render(params, **kwargs)

Render Product - this will render contents of Templates used as identifier for this Product, if a regular string was passed, this method has no effect

save_metadata(metadata)

to_json_serializable()

Returns a JSON serializable version of this product

upload()

delete(force=False)

Deletes the product

download()
exists()

This method returns True if the product exists, it is not part of the metadata, so there is no cached status

fetch_metadata()
render(params, **kwargs)

Render Product - this will render contents of Templates used as identifier for this Product, if a regular string was passed, this method has no effect

save_metadata(metadata)
to_json_serializable()

Returns a JSON serializable version of this product

upload()

Attributes

client

name

Used as identifier in the database

task