Skip to content

Commit

Permalink
Merge pull request #14 from aliyun/features/load_single_project
Browse files Browse the repository at this point in the history
[fix]:only load project with input project name
  • Loading branch information
bruceding authored Apr 23, 2024
2 parents 21d703e + b2c3940 commit fd73095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/api_fs_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions api/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Configuration struct {
regionId string
AccessKeyId string
AccessKeySecret string
projectName string
ProjectName string
UserAgent string
domain string
}
Expand All @@ -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,
}
Expand Down
3 changes: 3 additions & 0 deletions featurestore/feature_store_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fd73095

Please sign in to comment.