Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make feast registry-dump print the whole registry as one json #2040

Merged
merged 2 commits into from Nov 17, 2021

Conversation

nossrannug
Copy link
Contributor

@nossrannug nossrannug commented Nov 15, 2021

What this PR does / why we need it:
When running feast registry-dump, the whole registry is printed as one json.

I intentionally kept all the logic in repo_operations.py instead of adding a method to the Registry class since this is for debugging only.

Changes

The current implementation will print the json representation of each entity and feature view but none of the other objects such as feature services and on demand feature views. It is also not obvious which type each json represents.

{
  "spec": {
    "name": "driver_id",
    "valueType": "INT64",
    "description": "driver id",
    "joinKey": "driver_id"
  },
  "meta": {}
}
{
  "spec": {
    "name": "driver_hourly_stats",
    "entities": [
      "driver_id"
    ],
    "features": [
      {
        "name": "conv_rate",
        "valueType": "FLOAT"
      },
      {
        "name": "acc_rate",
        "valueType": "FLOAT"
      },
      {
        "name": "avg_daily_trips",
        "valueType": "INT64"
      }
    ],
    "ttl": "86400s",
    "batchSource": {
      "type": "BATCH_FILE",
      "eventTimestampColumn": "event_timestamp",
      "createdTimestampColumn": "created",
      "fileOptions": {
        "fileUrl": "/content/feature_repo/data/driver_stats.parquet"
      },
      "dataSourceClassType": "feast.infra.offline_stores.file_source.FileSource"
    },
    "online": true
  },
  "meta": {}
}

The change in this PR would print one json object containing a list of all objects of the registry.

Warning: The registry-dump command is for debugging only and may contain breaking changes in the future. No guarantees are made on this interface.
{
  "entities": [
    {
      "spec": {
        "name": "driver_id",
        "valueType": "INT64",
        "description": "driver id",
        "joinKey": "driver_id"
      },
      "meta": {}
    }
  ],
  "featureViews": [
    {
      "spec": {
        "name": "driver_hourly_stats",
        "entities": [
          "driver_id"
        ],
        "features": [
          {
            "name": "conv_rate",
            "valueType": "FLOAT"
          },
          {
            "name": "acc_rate",
            "valueType": "FLOAT"
          },
          {
            "name": "avg_daily_trips",
            "valueType": "INT64"
          }
        ],
        "ttl": "86400s",
        "batchSource": {
          "type": "BATCH_FILE",
          "eventTimestampColumn": "event_timestamp",
          "createdTimestampColumn": "created",
          "fileOptions": {
            "fileUrl": "/content/feature_repo/data/driver_stats.parquet"
          },
          "dataSourceClassType": "feast.infra.offline_stores.file_source.FileSource"
        },
        "online": true
      },
      "meta": {}
    }
  ],
  "featureServices": [
    {
      "spec": {
        "name": "driver_activity",
        "features": [
          {
            "featureViewName": "driver_hourly_stats",
            "featureColumns": [
              {
                "name": "avg_daily_trips",
                "valueType": "INT64"
              }
            ]
          },
          {
            "featureViewName": "driver_hourly_stats",
            "featureColumns": [
              {
                "name": "conv_rate",
                "valueType": "FLOAT"
              }
            ]
          }
        ]
      },
      "meta": {}
    }
  ]
}

The json object will contain entities, featureViews, featureTables, featureServices, onDemandFeatureViews, and requestFeatureViews.

NONE

Signed-off-by: Gunnar Sv Sigurbjörnsson <gunnar.sigurbjornsson@gmail.com>
@feast-ci-bot
Copy link
Collaborator

Hi @nossrannug. Thanks for your PR.

I'm waiting for a feast-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2021

Codecov Report

Merging #2040 (d8974c1) into master (d0a7863) will decrease coverage by 2.54%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2040      +/-   ##
==========================================
- Coverage   60.01%   57.47%   -2.55%     
==========================================
  Files         103      100       -3     
  Lines        8523     8044     -479     
==========================================
- Hits         5115     4623     -492     
- Misses       3408     3421      +13     
Flag Coverage Δ
unittests 57.47% <16.66%> (-2.55%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/repo_operations.py 42.42% <16.66%> (-1.53%) ⬇️
...dk/python/tensorflow_metadata/proto/v0/path_pb2.py
...hon/tensorflow_metadata/proto/v0/statistics_pb2.py
.../python/tensorflow_metadata/proto/v0/schema_pb2.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0a7863...d8974c1. Read the comment docs.

@woop
Copy link
Member

woop commented Nov 15, 2021

@nossrannug can you please describe the change (before / after)?

@nossrannug
Copy link
Contributor Author

Hey @woop, I've updated the top comment to include the before and after json blobs

@woop
Copy link
Member

woop commented Nov 16, 2021

Looks good to me. I think we should also print a warning that the registry-dump command may contain breaking changes in the future and that no guarantees are made on this interface.

it is for debugging only and should not be relied on.

Signed-off-by: Gunnar Sv Sigurbjörnsson <gunnar.sigurbjornsson@gmail.com>
@nossrannug
Copy link
Contributor Author

Added this message to the output:
Warning: The registry-dump command is for debugging only and may contain breaking changes in the future. No guarantees are made on this interface.

Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

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

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, nossrannug

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@felixwang9817
Copy link
Collaborator

/kind housekeeping

@feast-ci-bot feast-ci-bot merged commit 2886d3e into feast-dev:master Nov 17, 2021
@nossrannug nossrannug deleted the registry-dump-as-json branch November 18, 2021 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants