Repository: feast-dev/feast

Issue:
Saved Datasets breaks CLI registry-dump
## Expected Behavior

After creating a saved dataset, the CLI command `feast registry-dump` should dump the contents of the registry to the terminal.

## Current Behavior

After creating a saved dataset, the CLI command `feast registry-dump` breaks, with the following error:

```
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/feast", line 8, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/cli.py", line 562, in registry_dump_command
    click.echo(registry_dump(repo_config, repo_path=repo))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/usage.py", line 299, in wrapper
    raise exc.with_traceback(traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/usage.py", line 288, in wrapper
    return func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/repo_operations.py", line 353, in registry_dump
    registry_dict = registry.to_dict(project=project)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/infra/registry/base_registry.py", line 648, in to_dict
    self.list_saved_datasets(project=project), key=lambda item: item.name
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/infra/registry/registry.py", line 696, in list_saved_datasets
    return proto_registry_utils.list_saved_datasets(registry_proto, project)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feast/infra/registry/proto_registry_utils.py", line 217, in list_saved_datasets
    if saved_dataset.project == project:
AttributeError: project
```

This error is also replicated with a local clone of the master branch.

## Steps to reproduce

1. Create a saved dataset and save it with `store.create_saved_dataset()`
2. Run `feast registry-dump`

This can be replicated with this repository: https://github.com/malcolmk181/feast-dqm-tutorial/tree/61a8d46c1452e48d51504b1b2c252426d557e87e

Clone the repository and convert the `demo.py` into a notebook using `jupyter nbconvert demo.py --to notebook`.  This notebook generally follows the [Validating Historical Features](https://docs.feast.dev/tutorials/validating-historical-features) tutorial. If you run the cells up to and not including the cell that creates the saved dataset, `feast registry-dump` will run successfully, and dump the registry contents to the terminal. If you run the cell that creates the saved dataset and repeat `feast registry-dump`, the error will occur.

### Specifications

- Version: Feast 0.31.1 and Feast SDK 0.1.dev3032, Python 3.10.11
- Platform: Replicated in Debian 11.7 and macOS 12.6.8
- Subsystem:

## Possible Solution

The error is thrown by line 217 of the `list_saved_dataset()` function in `sdk/python/feast/infra/registry/proto_registry_utils.py`:

https://github.com/feast-dev/feast/blob/c75a01fce2d52cd18479ace748b8eb2e6c81c988/sdk/python/feast/infra/registry/proto_registry_utils.py#L217

I deserialized the `registry.db` file and after referencing the proto files found that the project attribute was successfully logged on the saved dataset object within the registry. It appears that within the `list_saved_datasets()` function that the `saved_dataset` proto needs to use `.spec` to access  the `project` attribute. This would be consistent with the `get_saved_dataset()` function:

https://github.com/feast-dev/feast/blob/c75a01fce2d52cd18479ace748b8eb2e6c81c988/sdk/python/feast/infra/registry/proto_registry_utils.py#L123



Discussion:

Resolving patch:
diff --git a/sdk/python/feast/infra/registry/proto_registry_utils.py b/sdk/python/feast/infra/registry/proto_registry_utils.py
--- a/sdk/python/feast/infra/registry/proto_registry_utils.py
+++ b/sdk/python/feast/infra/registry/proto_registry_utils.py
@@ -214,7 +214,7 @@ def list_saved_datasets(
 ) -> List[SavedDataset]:
     saved_datasets = []
     for saved_dataset in registry_proto.saved_datasets:
-        if saved_dataset.project == project:
+        if saved_dataset.spec.project == project:
             saved_datasets.append(SavedDataset.from_proto(saved_dataset))
     return saved_datasets
 


Test patch: