Skip to content

Conversation

@Inokinoki
Copy link
Member

Description

Add a pre-check in ML worker for Database constraints, referring to:

  • ai.giskard.domain.Callable
  • ai.giskard.domain.TestFunction
  • ai.giskard.domain.DatasetProcessFunction
  • ai.giskard.domain.SlicingFunction
  • ai.giskard.domain.TransformationFunction

So that the badly-made callable functions will not be sent to the backend (pydantic will raise an error).

Related Issue

[GSK-1888] Code for callable functions becomes NULL

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

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.

@linear
Copy link

linear bot commented Oct 25, 2023

GSK-1888 Code for callable functions becomes NULL

Internal Server Error
could not execute batch [Batch entry 0 insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,callable_type,uuid) values (NULL,'test_bias','This test checks if the answer generated by the LLM is ethically biased. See the code below.','__main__',NULL,'test_bias','["custom"]',1,'TEST','935ca3f6-6056-5a86-97a2-2e12e749ad67'::uuid) was aborted: ERROR: null value in column "code" of relation "callable_functions" violates not-null constraint
  Detail: Failing row contains (TEST, 935ca3f6-6056-5a86-97a2-2e12e749ad67, null, test_bias, This test checks if the answer generated by the LLM is ethically..., __main__, null, test_bias, ["custom"], 1, f, null, null, null).  Call getNextException to see other errors in the batch.] [insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,callable_type,uuid) values (?,?,?,?,?,?,?,?,'TEST',?)]; SQL [insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,callable_type,uuid) values (?,?,?,?,?,?,?,?,'TEST',?)]; constraint [code" of relation "callable_functions]

Reported by Steven

could not execute batch [NULL not allowed for column "CODE"; SQL statement:
insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,cell_level,clauses,column_type,process_type,callable_type,uuid) values (?,?,?,?,?,?,?,?,?,?,?,?,'SLICING',?) [23502-214]] [insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,cell_level,clauses,column_type,process_type,callable_type,uuid) values (?,?,?,?,?,?,?,?,?,?,?,?,'SLICING',?)]; SQL [insert into callable_functions (code,display_name,doc,module,module_doc,name,tags,version,cell_level,clauses,column_type,process_type,callable_type,uuid) values (?,?,?,?,?,?,?,?,?,?,?,?,'SLICING',?)]; constraint [null]

From Sentry.

Add as a pre-check here for Database constraints, referring to: 
- `ai.giskard.domain.Callable`
- `ai.giskard.domain.TestFunction`
- `ai.giskard.domain.DatasetProcessFunction`
- `ai.giskard.domain.SlicingFunction`
- `ai.giskard.domain.TransformationFunction`
@Hartorn Hartorn force-pushed the feature/gsk-1888-code-for-callable-functions-becomes-null branch from 6227544 to c6d7953 Compare October 30, 2023 14:35
@sonarqubecloud
Copy link

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Inokinoki Inokinoki merged commit 7e6318b into main Oct 31, 2023
@Inokinoki Inokinoki deleted the feature/gsk-1888-code-for-callable-functions-becomes-null branch October 31, 2023 04:48
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.

3 participants