sdk/python/feast/infra/online_stores/astra.py
def _create_cql_table(key_space: str,
                      table_name: str,
                      primary_key: List,
                      columns: List[str],
                      column_types: List[str]
                      ) -> str:
    """
    This is general function that will create a CQL to create a table
    """
    assert len(columns) > 0, "Columns can not be empty in a Table. "

    assert len(columns) == len(column_types), "Length of columns and type of columns length missmatch."

    # If we have same amount of columns and their types
    cql_create_table = "CREATE TABLE IF NOT EXISTS " + key_space + "." + table_name
    cql_create_table += " ("
    for col, typ in zip(columns, column_types):
        if col in primary_key:
            cql_create_table += col + " " + typ + ", "
        else:
            cql_create_table += col + " " + typ + " , "
    cql_create_table = cql_create_table[:-2]
    cql_create_table += ", PRIMARY KEY (" + ", ".join(primary_key) + ") "
    cql_create_table += ");"
    return cql_create_table

    This is general function that will create a CQL to create a table
    
This is general function that will create a CQL to create a table
This is general function that will create a CQL to create a table
def _create_cql_table(key_space: str,
                      table_name: str,
                      primary_key: List,
                      columns: List[str],
                      column_types: List[str]
                      ) -> str:
    assert len(columns) > 0, "Columns can not be empty in a Table. "
    assert len(columns) == len(column_types), "Length of columns and type of columns length missmatch."
    cql_create_table = "CREATE TABLE IF NOT EXISTS " + key_space + "." + table_name
    cql_create_table += " ("
    for col, typ in zip(columns, column_types):
        if col in primary_key:
            cql_create_table += col + " " + typ + ", "
        else:
            cql_create_table += col + " " + typ + " , "
    cql_create_table = cql_create_table[:-2]
    cql_create_table += ", PRIMARY KEY (" + ", ".join(primary_key) + ") "
    cql_create_table += ");"
    return cql_create_table
def _create_cql_table ( key_space : str , table_name : str , primary_key : List , columns : List [ str ] , column_types : List [ str ] ) -> str : assert len ( columns ) > 0 , "Columns can not be empty in a Table. " assert len ( columns ) == len ( column_types ) , "Length of columns and type of columns length missmatch." cql_create_table = "CREATE TABLE IF NOT EXISTS " + key_space + "." + table_name cql_create_table += " (" for col , typ in zip ( columns , column_types ) : if col in primary_key : cql_create_table += col + " " + typ + ", " else : cql_create_table += col + " " + typ + " , " cql_create_table = cql_create_table [ : - 2 ] cql_create_table += ", PRIMARY KEY (" + ", " . join ( primary_key ) + ") " cql_create_table += ");" return cql_create_table
This is general function that will create a CQL to create a table
This is general function that will create a CQL to create a table
"""
    This is general function that will create a CQL to create a table
    """ # If we have same amount of columns and their types

key_space
str
table_name
str
primary_key
List
columns
List[str]
column_types
List[str]