Skip to content

GSK-1272- Filter slicing functions clauses when column name are not available#1175

Merged
kevinmessiaen merged 44 commits intomainfrom
feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects
Sep 11, 2023
Merged

GSK-1272- Filter slicing functions clauses when column name are not available#1175
kevinmessiaen merged 44 commits intomainfrom
feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects

Conversation

@kevinmessiaen
Copy link
Copy Markdown
Member

@kevinmessiaen kevinmessiaen commented Jun 14, 2023

Description

Filter slicing functions clauses when column name are not available
In slicing function catalog, filter dataset for clause based functions

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

@linear
Copy link
Copy Markdown

linear Bot commented Jun 14, 2023

GSK-1280 Slicing functions are being shared between all projects

We can see all slicing functions when debugging a model/dataset, even if the dataset doesn't contain the columns displayed on the slicing function list.

image.png

image.png

How to reproduce:

  1. Create a first project following a notebook (e.g. trip advisor) and upload the scan results
  2. Create a second project directly on the UI and follow the code snippet (titanic) and upload the scan results
  3. Go to the first project, create a new debugging session, and interact with the "Slice to apply" list

@kevinmessiaen kevinmessiaen marked this pull request as ready for review June 21, 2023 05:36
kevinmessiaen and others added 4 commits June 27, 2023 08:38
…-shared-between-all-projects

# Conflicts:
#	frontend/src/views/main/utils/DatasetSelector.vue
#	frontend/src/views/main/utils/SlicingFunctionSelector.vue
@andreybavt
Copy link
Copy Markdown
Contributor

andreybavt commented Jul 4, 2023

@kevinmessiaen, we still don't separate uploaded slicing functions per project. This causes a problem for example with slicing function upload:

The snippet below fails on last row execution because SlicingFunctionController isn't ready to take project/{projectKey} inside urls

This is because today we don't store a link between a slicing function and a project, but we should. Then, when accessing a list of slicing functions in the UI we should filter based on whether a given slicing function belongs to a project or not

(same probably applies to transformation functions)

def test_upload():
    import pandas as pd

    import giskard
    from giskard import slicing_function

    # Create a Giskard client
    token = "XXX"  # API Access Token
    client = giskard.GiskardClient(
        url="http://localhost:9000", token=token  # URL of your Giskard instance
    )

    @slicing_function(row_level=False)
    def my_func1(df: pd.DataFrame):
        df["Age"] = df["Age"] > 1
        return df

    my_func1.upload(client, "slicing")

@andreybavt
Copy link
Copy Markdown
Contributor

@kevinmessiaen , I fixed the project-level slicing function upload, there's just the part of filtering of the UI left. Inside the project you should only see global artefacts and the ones uploaded to this project.

@kevinmessiaen
Copy link
Copy Markdown
Member Author

@kevinmessiaen , I fixed the project-level slicing function upload, there's just the part of filtering of the UI left. Inside the project you should only see global artefacts and the ones uploaded to this project.

@andreybavt it's now handled in the UI as well as some improvement in the backend

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

7.8% 7.8% Coverage
0.4% 0.4% Duplication

@kevinmessiaen kevinmessiaen marked this pull request as draft July 26, 2023 08:58
@kevinmessiaen kevinmessiaen changed the title Filter slicing functions clauses when column name are not available GSK-1272- Filter slicing functions clauses when column name are not available Jul 26, 2023
@linear
Copy link
Copy Markdown

linear Bot commented Jul 26, 2023

GSK-1272 Uploading test suite to two different projects causes strange behaviour

When I do

test_suite.upload(client, "project_1")
test_suite.upload(client, "project_2")

I will get a test suite in project 2 which is empty, but can be executed:

Screenshot 2023-06-07 at 14.27.16.png

…-shared-between-all-projects

# Conflicts:
#	backend/src/main/java/ai/giskard/domain/DatasetProcessFunction.java
#	backend/src/main/java/ai/giskard/service/SlicingFunctionService.java
#	backend/src/main/java/ai/giskard/service/ml/MLWorkerCacheService.java
#	backend/src/main/java/ai/giskard/web/rest/controllers/DatasetsController.java
#	backend/src/main/java/ai/giskard/web/rest/controllers/SlicingFunctionController.java
#	backend/src/main/java/ai/giskard/web/rest/controllers/TransformationFunctionController.java
#	backend/src/main/resources/config/liquibase/master.xml
#	frontend/src/api.ts
#	frontend/src/stores/catalog.ts
#	frontend/src/views/main/project/FiltersCatalog.vue
#	frontend/src/views/main/project/TransformationsCatalog.vue
#	frontend/src/views/main/utils/DatasetSelector.vue
#	frontend/src/views/main/utils/SlicingFunctionSelector.vue
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented Sep 5, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
7997207 Generic High Entropy Secret f04d591 python-client/test.ipynb View secret
7997207 Generic High Entropy Secret 4a72cf4 python-client/test.ipynb View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

kevinmessiaen and others added 3 commits September 5, 2023 13:30
…ns-are-being-shared-between-all-projects' into feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects
@kevinmessiaen kevinmessiaen marked this pull request as ready for review September 5, 2023 06:36
@kevinmessiaen kevinmessiaen removed the request for review from henchaves September 5, 2023 06:36
…-shared-between-all-projects

# Conflicts:
#	backend/src/main/java/ai/giskard/service/DatasetProcessFunctionService.java
#	backend/src/main/java/ai/giskard/service/SlicingFunctionService.java
Copy link
Copy Markdown
Contributor

@andreybavt andreybavt left a comment

Choose a reason for hiding this comment

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

@kevinmessiaen , generally the PR looks good to me. Could you just replace the modified getCatalog and createSlicingFunction in api.ts by the autogenerated api-v2.ts methods and remove both of them from api.ts. Like this we don't add extra work for the migration in the future

andreybavt and others added 4 commits September 8, 2023 15:03
…ns-are-being-shared-between-all-projects' into feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects
…ns-are-being-shared-between-all-projects' into feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects
@kevinmessiaen kevinmessiaen merged commit 1d6df7d into main Sep 11, 2023
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

13.3% 13.3% Coverage
0.4% 0.4% Duplication

@Hartorn Hartorn deleted the feature/gsk-1280-slicing-functions-are-being-shared-between-all-projects branch September 13, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants