Skip to content

Commit fd73095

Browse files
authored
Merge pull request #14 from aliyun/features/load_single_project
[fix]:only load project with input project name
2 parents 21d703e + b2c3940 commit fd73095

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

api/api_fs_project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FsProjectApiService List Projects
2222
*/
2323
func (a *FsProjectApiService) ListProjects() (ListProjectsResponse, error) {
2424
request := paifeaturestore.ListProjectsRequest{}
25-
request.SetName(a.client.cfg.projectName)
25+
request.SetName(a.client.cfg.ProjectName)
2626

2727
response, err := a.client.ListProjects(&a.client.instanceId, &request)
2828
var (

api/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type Configuration struct {
66
regionId string
77
AccessKeyId string
88
AccessKeySecret string
9-
projectName string
9+
ProjectName string
1010
UserAgent string
1111
domain string
1212
}
@@ -15,7 +15,7 @@ func NewConfiguration(regionId, accessKeyId, accessKeySecret, projectName string
1515
cfg := &Configuration{
1616
UserAgent: "PAI-FeatureStore/1.0.0/go",
1717
regionId: regionId,
18-
projectName: projectName,
18+
ProjectName: projectName,
1919
AccessKeyId: accessKeyId,
2020
AccessKeySecret: accessKeySecret,
2121
}

featurestore/feature_store_client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ func (c *FeatureStoreClient) LoadProjectData() {
169169
}
170170

171171
for _, p := range listProjectsResponse.Projects {
172+
if p.ProjectName != c.client.GetConfig().ProjectName {
173+
continue
174+
}
172175
// get datasource
173176
getDataSourceResponse, err := c.client.DatasourceApi.DatasourceDatasourceIdGet(p.OnlineDatasourceId)
174177
if err != nil {

0 commit comments

Comments
 (0)