Content-Length: 3701 | pFad | http://github.com/postgresml/postgresml/pull/963.diff
thub.com
diff --git a/pgml-dashboard/sqlx-data.json b/pgml-dashboard/sqlx-data.json
index 11e7eb7ac..43e46d4a9 100644
--- a/pgml-dashboard/sqlx-data.json
+++ b/pgml-dashboard/sqlx-data.json
@@ -566,7 +566,7 @@
"nullable": [
false,
false,
- false,
+ true,
false,
false,
null,
@@ -864,7 +864,7 @@
"nullable": [
false,
false,
- false,
+ true,
false,
false,
null,
@@ -1113,7 +1113,7 @@
"nullable": [
false,
false,
- false,
+ true,
false,
false,
null,
diff --git a/pgml-dashboard/src/lib.rs b/pgml-dashboard/src/lib.rs
index 18900f1e7..4d0f7cf89 100644
--- a/pgml-dashboard/src/lib.rs
+++ b/pgml-dashboard/src/lib.rs
@@ -367,7 +367,12 @@ pub async fn models_index(cluster: ConnectedCluster<'_>) -> Result")]
pub async fn models_get(cluster: ConnectedCluster<'_>, id: i64) -> Result {
let model = models::Model::get_by_id(cluster.pool(), id).await?;
- let snapshot = models::Snapshot::get_by_id(cluster.pool(), model.snapshot_id).await?;
+ let snapshot = if let Some(snapshot_id) = model.snapshot_id {
+ Some(models::Snapshot::get_by_id(cluster.pool(), snapshot_id).await?)
+ } else {
+ None
+ };
+
let project = models::Project::get_by_id(cluster.pool(), model.project_id).await?;
Ok(ResponseOk(
diff --git a/pgml-dashboard/src/models.rs b/pgml-dashboard/src/models.rs
index b4aa48a0b..649455247 100644
--- a/pgml-dashboard/src/models.rs
+++ b/pgml-dashboard/src/models.rs
@@ -444,7 +444,7 @@ pub enum Runtime {
pub struct Model {
pub id: i64,
pub project_id: i64,
- pub snapshot_id: i64,
+ pub snapshot_id: Option,
pub num_features: i32,
pub algorithm: String,
pub runtime: Option,
diff --git a/pgml-dashboard/src/templates/mod.rs b/pgml-dashboard/src/templates/mod.rs
index b1bb25fb7..e38b275f6 100644
--- a/pgml-dashboard/src/templates/mod.rs
+++ b/pgml-dashboard/src/templates/mod.rs
@@ -397,7 +397,7 @@ pub struct Models {
pub struct Model {
pub model: models::Model,
pub project: models::Project,
- pub snapshot: models::Snapshot,
+ pub snapshot: Option,
pub deployed: bool,
}
diff --git a/pgml-dashboard/templates/content/dashboard/panels/model.html b/pgml-dashboard/templates/content/dashboard/panels/model.html
index d60de69aa..dc1b392d0 100644
--- a/pgml-dashboard/templates/content/dashboard/panels/model.html
+++ b/pgml-dashboard/templates/content/dashboard/panels/model.html
@@ -13,8 +13,10 @@
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/postgresml/postgresml/pull/963.diff
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy