-
Notifications
You must be signed in to change notification settings - Fork 318
Refactor the initialization of GUC parameters. #1360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
let task_json = format!(json_template!(), model, false); | ||
let task: Value = serde_json::from_str(&task_json).unwrap(); | ||
assert!(verify_task(&task).is_ok()); | ||
|
||
let task_json = format!(json_template!(), model, true); | ||
let task: Value = serde_json::from_str(&task_json).unwrap(); | ||
assert!(verify_task(&task).is_ok()); | ||
assert!(verify_task(&task).is_err()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the initial commit of this test, this step should fail with RemoteCodeNotTrusted
.
postgresml/pgml-extension/src/bindings/transformers/whitelist.rs
Lines 189 to 192 in f4e87c5
assert_eq!( | |
verify_task_against_whitelist(&task), | |
Err(WhitelistError::RemoteCodeNotTrusted) | |
); |
"Whether model can execute remote codes", | ||
"", | ||
&PGML_HF_TRUST_REMOTE_CODE.1, | ||
GucContext::Userset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we make these GUCs SUSET
?
SUSET options can be set at postmaster startup, with the SIGHUP mechanism, or from the startup packet or SQL if you're a superuser.
Managing GUC parameters in different places is hard to maintain. This patch organizes GUC definitions in a single place. Also, we use define_xxx_guc() APIs to define these parameters and it will allow us to manage GucContext, GucFlags in future. P.S., the test case test_trusted_model doesn't seem correct. I fixed it in this patch.
a868029
to
4612b4f
Compare
Merged in commit f674f70 |
Managing GUC parameters in different places is hard to maintain. This patch organizes GUC definitions in a single place. Also, we use define_xxx_guc() APIs to define these parameters and it will allow us to manage GucContext, GucFlags in future.
P.S., the test case test_trusted_model doesn't seem correct. I fixed it in this patch.