Skip to content

Commit

Permalink
#762 | Remove unused schema param in createQuestionForTable() and rem…
Browse files Browse the repository at this point in the history
…ove unused DatabaseService from MetabaseService
  • Loading branch information
himeshr committed Sep 12, 2024
1 parent 837a48c commit f26b6fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ public void createQuestionForTable(TableDetails tableDetails, TableDetails addre
}

@Override
public void createQuestionForTable(String tableName, String schema) {
public void createQuestionForTable(String tableName) {
Database database = getGlobalDatabase();

TableDetails tableDetails = new TableDetails();
tableDetails.setName(tableName);
TableDetails tableDetails = new TableDetails(tableName);
TableDetails fetchedTableDetails = databaseRepository.findTableDetailsByName(database, tableDetails);

databaseRepository.createQuestionForASingleTable(database, fetchedTableDetails);
Expand Down Expand Up @@ -120,8 +119,7 @@ private void createQuestionsForEntities(List<String> entityNames, FieldDetails a
List<String> filteredEntities = filterOutExistingQuestions(entityNames);

for (String entityName : filteredEntities) {
TableDetails entityTableDetails = new TableDetails();
entityTableDetails.setName(entityName);
TableDetails entityTableDetails = new TableDetails(entityName);
TableDetails fetchedEntityTableDetails = databaseRepository.findTableDetailsByName(getGlobalDatabase(), entityTableDetails);
createQuestionForTable(fetchedEntityTableDetails, fetchedAddressTableDetails, addressFieldDetails, entityFieldDetails);
}
Expand All @@ -148,7 +146,7 @@ public void createQuestionsForIndividualTables() {
List<String> filteredTables = filterOutExistingQuestions(individualTables);

for (String tableName : filteredTables) {
createQuestionForTable(tableName, "!public");
createQuestionForTable(tableName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class MetabaseService {
private final OrganisationService organisationService;
private final AvniDatabase avniDatabase;
private final DatabaseRepository databaseRepository;
private final DatabaseService databaseService;
private final GroupPermissionsRepository groupPermissionsRepository;
private final CollectionPermissionsRepository collectionPermissionsRepository;
private final CollectionRepository collectionRepository;
Expand All @@ -29,14 +28,12 @@ public class MetabaseService {
public MetabaseService(OrganisationService organisationService,
AvniDatabase avniDatabase,
DatabaseRepository databaseRepository,
@Lazy DatabaseService databaseService,
GroupPermissionsRepository groupPermissionsRepository,
CollectionPermissionsRepository collectionPermissionsRepository,
CollectionRepository collectionRepository) {
this.organisationService = organisationService;
this.avniDatabase = avniDatabase;
this.databaseRepository = databaseRepository;
this.databaseService = databaseService;
this.groupPermissionsRepository = groupPermissionsRepository;
this.collectionPermissionsRepository = collectionPermissionsRepository;
this.collectionRepository = collectionRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

public interface QuestionCreationService {
void createQuestionForTable(TableDetails tableDetails, TableDetails addressTableDetails, FieldDetails addressFieldDetails, FieldDetails tableFieldDetails) throws Exception;
void createQuestionForTable(String tableName, String schema) throws Exception;
void createQuestionForTable(String tableName) throws Exception;
}

0 comments on commit f26b6fc

Please sign in to comment.