Skip to content

Failure when there is a hyphen in project names #1545

Closed

Description

@woop

Expected Behavior

Able to run feast apply when there is a hyphen in the project name

Current Behavior

Registered entity year_month_day
Registered feature view serve_weather_features
Deploying infrastructure for serve_weather_features
Traceback (most recent call last):
  File "/home/willem/.pyenv/versions/3.7.7/bin/feast", line 33, in <module>
    sys.exit(load_entry_point('feast', 'console_scripts', 'feast')())
  File "/home/willem/.pyenv/versions/3.7.7/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/willem/.pyenv/versions/3.7.7/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/willem/.pyenv/versions/3.7.7/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/willem/.pyenv/versions/3.7.7/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/willem/.pyenv/versions/3.7.7/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/willem/Projects/feast/sdk/python/feast/cli.py", line 163, in apply_total_command
    apply_total(repo_config, Path.cwd())
  File "/home/willem/Projects/feast/sdk/python/feast/repo_operations.py", line 208, in apply_total
    partial=False,
  File "/home/willem/Projects/feast/sdk/python/feast/infra/local.py", line 61, in update_infra
    f"CREATE TABLE IF NOT EXISTS {_table_id(project, table)} (entity_key BLOB, feature_name TEXT, value BLOB, event_ts timestamp, created_ts timestamp,  PRIMARY KEY(entity_key, feature_name))"
sqlite3.OperationalError: near "-": syntax error

Steps to reproduce

Clone https://github.com/dmatrix/mlflow-tests/tree/master/py/delta-lake
Run feast apply

Specifications

  • Version: 0.10.3

Possible Solution

The problem is that we don't support hyphens in project names. We should either prevent the use of hyphens or support them at the storage layer.

Activity

  1. dmatrix commented on May 8, 2021

    @dmatrix
    Contributor

    @woop As you know, SQLite disallows "-" in a table name. For example:

    sqlite3 bug.db 'create table-with-dash" ("col" text)'
    Error: near "-": syntax error
    

    SQLite does not support this at the storage layer, albeit creates the "bug.db" database without a table.

    Since the feast apply uses the project:<name> table from the feature_store.yaml, created by feast init <name>, does it make sense to parse the argument to the feast init <name> and flag an error, disallowing its usage?

    Preventing the use of "-" might be an easier workaround early on, during initializing a feast repo, unless you want to support “-“ at both local and remote storage layers.

    WDYT?

  2. woop commented on May 9, 2021

    @woop
    MemberAuthor

    @woop As you know, SQLite disallows "-" in a table name. For example:

    sqlite3 bug.db 'create table-with-dash" ("col" text)'
    Error: near "-": syntax error
    

    SQLite does not support this at the storage layer, albeit creates the "bug.db" database without a table.

    Since the feast apply uses the project:<name> table from the feature_store.yaml, created by feast init <name>, does it make sense to parse the argument to the feast init <name> and flag an error, disallowing its usage?

    Preventing the use of "-" might be an easier workaround early on, during initializing a feast repo, unless you want to support “-“ at both local and remote storage layers.

    WDYT?

    Spot on. It may be easiest to just allow alphanumeric values and underscores in project names as a start. As you say, validation would have to happen during init and also during apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions