From b2c3940ff180b7a8ced2e334b58c248e155553c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E6=9E=AB?= Date: Tue, 23 Apr 2024 15:17:47 +0800 Subject: [PATCH] [fix]:only load project with input project name --- api/api_fs_project.go | 2 +- api/configuration.go | 4 ++-- featurestore/feature_store_client.go | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/api_fs_project.go b/api/api_fs_project.go index fc4b12b..075eb15 100644 --- a/api/api_fs_project.go +++ b/api/api_fs_project.go @@ -22,7 +22,7 @@ FsProjectApiService List Projects */ func (a *FsProjectApiService) ListProjects() (ListProjectsResponse, error) { request := paifeaturestore.ListProjectsRequest{} - request.SetName(a.client.cfg.projectName) + request.SetName(a.client.cfg.ProjectName) response, err := a.client.ListProjects(&a.client.instanceId, &request) var ( diff --git a/api/configuration.go b/api/configuration.go index a45035f..6a1ac57 100644 --- a/api/configuration.go +++ b/api/configuration.go @@ -6,7 +6,7 @@ type Configuration struct { regionId string AccessKeyId string AccessKeySecret string - projectName string + ProjectName string UserAgent string domain string } @@ -15,7 +15,7 @@ func NewConfiguration(regionId, accessKeyId, accessKeySecret, projectName string cfg := &Configuration{ UserAgent: "PAI-FeatureStore/1.0.0/go", regionId: regionId, - projectName: projectName, + ProjectName: projectName, AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, } diff --git a/featurestore/feature_store_client.go b/featurestore/feature_store_client.go index 7197fb9..f630aa1 100644 --- a/featurestore/feature_store_client.go +++ b/featurestore/feature_store_client.go @@ -169,6 +169,9 @@ func (c *FeatureStoreClient) LoadProjectData() { } for _, p := range listProjectsResponse.Projects { + if p.ProjectName != c.client.GetConfig().ProjectName { + continue + } // get datasource getDataSourceResponse, err := c.client.DatasourceApi.DatasourceDatasourceIdGet(p.OnlineDatasourceId) if err != nil {