SQLCode

class getml.pipeline.SQLCode(code)

Bases: object

Custom class for handling the SQL code of the features generated by the pipeline.

Example

sql_code = my_pipeline.features.to_sql()

# You can access individual features
# by index.
feature_1_1 = sql_code[0]

# You can also access them by name.
feature_1_10 = sql_code["FEATURE_1_10"]

# You can also type the name of
# a table or column to find all
# features related to that table
# or column.
features = sql_code.find("SOME_TABLE")

# HINT: The generated SQL code always
# escapes table and column names using
# quotation marks. So if you want exact
# matching, you can do this:
features = sql_code.find('"SOME_TABLE"')

Methods Summary

find(keyword)

Returns the SQLCode for all features containing the keyword.

save(fname)

Saves the SQL code to a file.

to_str()

Returns a raw string representation of the SQL code.

Methods Documentation

find(keyword)

Returns the SQLCode for all features containing the keyword.

Parameters

keyword (str) – The keyword to be found.

save(fname)

Saves the SQL code to a file.

Parameters

fname (str) – The name of the file in which you want to save the features.

to_str()

Returns a raw string representation of the SQL code.