tembo-io / pg_vectorize

The simplest way to build AI workloads on Postgres
https://tembo.io/pg_vectorize/
739 stars 33 forks source link

Update error reporting for empty and null columns while initializing. #82

Closed EvanHStanton closed 8 months ago

EvanHStanton commented 8 months ago

Updated utils.rs error reporting for cases where columns are either non-existent or null.

        let job_id: i64 = result_row
            .get_by_name("job_id")
            .expect("job_id column does not exist.")
            .expect("job_id column was null.");
        let name: String = result_row
            .get_by_name("name")
            .expect("name column does not exist.")
            .expect("name column was null.");
        let job_type: String = result_row
            .get_by_name("job_type")
            .expect("job_type column does not exist.")
            .expect("job_type column was null.");
        let transformer: String = result_row
            .get_by_name("transformer")
            .expect("transformer column does not exist.")
            .expect("transformer column was null.");
        let search_alg: String = result_row
            .get_by_name("search_alg")
            .expect("search_alg column does not exist.")
            .expect("search_alg column was null.");
        let params: pgrx::JsonB = result_row
            .get_by_name("params")
            .expect("params column does not exist.")
            .expect("params column was null.");