FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Adding Click command to display configuration details by ShaktidharK1997 · Pull Request #5036 · feast-dev/feast · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .py  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
23 changes: 23 additions & 0 deletions docs/reference/feast-cli-commands.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Options:

Commands:
apply Create or update a feature store deployment
configuration Display Feast configuration
entities Access entities
feature-views Access feature views
init Create a new Feast repository
Expand Down Expand Up @@ -61,6 +62,28 @@ feast apply
`feast apply` \(when configured to use cloud provider like `gcp` or `aws`\) will create cloud infrastructure. This may incur costs.
{% endhint %}

## Configuration

Display the actual configuration being used by Feast, including both user-provided configurations and default configurations applied by Feast.

```bash
feast configuration
```

```yaml
project: foo
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db
offline_store:
type: dask
entity_key_serialization_version: 2
auth:
type: no_auth
```

## Entities

List all registered entities
Expand Down
18 changes: 18 additions & 0 deletions sdk/python/feast/cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ def version():
print(f'Feast SDK Version: "{importlib_version("feast")}"')


@cli.command()
@click.pass_context
def configuration(ctx: click.Context):
"""
Display Feast configuration
"""
repo = ctx.obj["CHDIR"]
fs_yaml_file = ctx.obj["FS_YAML_FILE"]
cli_check_repo(repo, fs_yaml_file)
repo_config = load_repo_config(repo, fs_yaml_file)
if repo_config:
config_dict = repo_config.model_dump(by_alias=True, exclude_unset=True)
config_dict.pop("repo_path", None)
print(yaml.dump(config_dict, default_flow_style=False, sort_keys=False))
else:
print("No configuration found.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice! Any chance you can add a unit test?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

and also update the dev guide docs, thanks!



@cli.command()
@click.option(
"--host",
Expand Down
20 changes: 20 additions & 0 deletions sdk/python/tests/unit/cli/test_cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,23 @@ def setup_third_party_registry_store_repo(
)

yield repo_path


def test_cli_configuration():
"""
Unit test for the 'feast configuration' command
"""
runner = CliRunner()

with setup_third_party_provider_repo("local") as repo_path:
# Run the 'feast configuration' command
return_code, output = runner.run_with_output(["configuration"], cwd=repo_path)

# Assertions
assertpy.assert_that(return_code).is_equal_to(0)
assertpy.assert_that(output).contains(b"project: foo")
assertpy.assert_that(output).contains(b"provider: local")
assertpy.assert_that(output).contains(b"type: sqlite")
assertpy.assert_that(output).contains(b"path: data/online_store.db")
assertpy.assert_that(output).contains(b"type: file")
assertpy.assert_that(output).contains(b"entity_key_serialization_version: 2")

Back | FazBrowse Home | New Git URL