Skip to content

Commit

Permalink
jiter compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Sep 19, 2023
1 parent fb7b501 commit 61993fd
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 167 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -43,6 +43,7 @@ base64 = "0.21.4"
num-bigint = "0.4.4"
python3-dll-a = "0.2.7"
uuid = "1.4.1"
jiter = {path = "../jiter", features = ["python"]}

[lib]
name = "_pydantic_core"
Expand Down
6 changes: 4 additions & 2 deletions src/errors/line_error.rs
Expand Up @@ -2,7 +2,9 @@ use pyo3::exceptions::PyTypeError;
use pyo3::prelude::*;
use pyo3::PyDowncastError;

use crate::input::{Input, JsonInput};
use jiter::JsonValue;

use crate::input::Input;

use super::location::{LocItem, Location};
use super::types::ErrorType;
Expand Down Expand Up @@ -147,7 +149,7 @@ impl<'a> ValLineError<'a> {
#[derive(Clone)]
pub enum InputValue<'a> {
PyAny(&'a PyAny),
JsonInput(JsonInput),
JsonInput(JsonValue),
String(&'a str),
}

Expand Down
6 changes: 4 additions & 2 deletions src/input/input_abstract.rs
Expand Up @@ -3,12 +3,14 @@ use std::fmt;
use pyo3::types::{PyDict, PyType};
use pyo3::{intern, prelude::*};

use jiter::JsonValue;

use crate::errors::{InputValue, LocItem, ValResult};
use crate::{PyMultiHostUrl, PyUrl};

use super::datetime::{EitherDate, EitherDateTime, EitherTime, EitherTimedelta};
use super::return_enums::{EitherBytes, EitherInt, EitherString};
use super::{EitherFloat, GenericArguments, GenericIterable, GenericIterator, GenericMapping, JsonInput};
use super::{EitherFloat, GenericArguments, GenericIterable, GenericIterator, GenericMapping};

#[derive(Debug, Clone, Copy)]
pub enum InputType {
Expand Down Expand Up @@ -70,7 +72,7 @@ pub trait Input<'a>: fmt::Debug + ToPyObject {

fn validate_dataclass_args(&'a self, dataclass_name: &str) -> ValResult<'a, GenericArguments<'a>>;

fn parse_json(&'a self) -> ValResult<'a, JsonInput>;
fn parse_json(&'a self) -> ValResult<'a, JsonValue>;

fn validate_str(&'a self, strict: bool) -> ValResult<EitherString<'a>> {
if strict {
Expand Down

0 comments on commit 61993fd

Please sign in to comment.