Skip to content

Commit

Permalink
Merge branch 'main' into cm/add-flows-homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranMn authored May 13, 2024
2 parents 03ed02d + 0d0b0d5 commit c949304
Show file tree
Hide file tree
Showing 31 changed files with 791 additions and 4 deletions.
4 changes: 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"libs/@local/hash-authorization",
"libs/@local/hash-graph-types/rust",
"libs/@local/hash-validation",
"libs/@local/repo-chores/rust",
"libs/@local/temporal-client",
"libs/@local/temporal-versioning",
"tests/hash-graph-integration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ export const upgradeWebEntities = async ({
all: [
{
any: entityTypeBaseUrls.map((baseUrl) => ({
equal: [
{ path: ["type(inheritanceDepth = 0)", "baseUrl"] },
{ parameter: baseUrl },
all: [
{
equal: [
{ path: ["type(inheritanceDepth = 0)", "baseUrl"] },
{ parameter: baseUrl },
],
},
{
less: [
{ path: ["type(inheritanceDepth = 0)", "version"] },
{ parameter: migrationState.entityTypeVersions[baseUrl] },
],
},
],
})),
},
Expand Down
48 changes: 48 additions & 0 deletions apps/hash-graph/libs/api/src/rest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,54 @@ impl Modify for FilterSchemaAddon {
)
.required("notEqual"),
)
.item(
ObjectBuilder::new()
.title(Some("GreaterFilter"))
.property(
"greater",
ArrayBuilder::new()
.items(Ref::from_schema_name("FilterExpression"))
.min_items(Some(2))
.max_items(Some(2)),
)
.required("notEqual"),
)
.item(
ObjectBuilder::new()
.title(Some("GreaterOrEqualFilter"))
.property(
"greaterOrEqual",
ArrayBuilder::new()
.items(Ref::from_schema_name("FilterExpression"))
.min_items(Some(2))
.max_items(Some(2)),
)
.required("notEqual"),
)
.item(
ObjectBuilder::new()
.title(Some("LessFilter"))
.property(
"less",
ArrayBuilder::new()
.items(Ref::from_schema_name("FilterExpression"))
.min_items(Some(2))
.max_items(Some(2)),
)
.required("notEqual"),
)
.item(
ObjectBuilder::new()
.title(Some("LessOrEqualFilter"))
.property(
"lessOrEqual",
ArrayBuilder::new()
.items(Ref::from_schema_name("FilterExpression"))
.min_items(Some(2))
.max_items(Some(2)),
)
.required("notEqual"),
)
.item(
ObjectBuilder::new()
.title(Some("CosineDistanceFilter"))
Expand Down
16 changes: 16 additions & 0 deletions apps/hash-graph/libs/graph/src/store/postgres/query/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,22 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> {
rhs.as_ref()
.map(|expression| self.compile_filter_expression(expression).0),
),
Filter::Greater(lhs, rhs) => Condition::Greater(
self.compile_filter_expression(lhs).0,
self.compile_filter_expression(rhs).0,
),
Filter::GreaterOrEqual(lhs, rhs) => Condition::GreaterOrEqual(
self.compile_filter_expression(lhs).0,
self.compile_filter_expression(rhs).0,
),
Filter::Less(lhs, rhs) => Condition::Less(
self.compile_filter_expression(lhs).0,
self.compile_filter_expression(rhs).0,
),
Filter::LessOrEqual(lhs, rhs) => Condition::LessOrEqual(
self.compile_filter_expression(lhs).0,
self.compile_filter_expression(rhs).0,
),
Filter::CosineDistance(lhs, rhs, max) => match (lhs, rhs) {
(FilterExpression::Path(path), FilterExpression::Parameter(parameter))
| (FilterExpression::Parameter(parameter), FilterExpression::Path(path)) => {
Expand Down
14 changes: 14 additions & 0 deletions apps/hash-graph/libs/graph/src/store/query/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ pub enum Filter<'p, R: QueryRecord + ?Sized> {
Option<FilterExpression<'p, R>>,
Option<FilterExpression<'p, R>>,
),
Greater(FilterExpression<'p, R>, FilterExpression<'p, R>),
GreaterOrEqual(FilterExpression<'p, R>, FilterExpression<'p, R>),
Less(FilterExpression<'p, R>, FilterExpression<'p, R>),
LessOrEqual(FilterExpression<'p, R>, FilterExpression<'p, R>),
CosineDistance(
FilterExpression<'p, R>,
FilterExpression<'p, R>,
Expand Down Expand Up @@ -169,6 +173,16 @@ where
) => parameter.convert_to_parameter_type(path.expected_type())?,
(..) => {}
},
Self::Greater(lhs, rhs)
| Self::GreaterOrEqual(lhs, rhs)
| Self::Less(lhs, rhs)
| Self::LessOrEqual(lhs, rhs) => match (lhs, rhs) {
(FilterExpression::Parameter(parameter), FilterExpression::Path(path))
| (FilterExpression::Path(path), FilterExpression::Parameter(parameter)) => {
parameter.convert_to_parameter_type(path.expected_type())?;
}
(..) => {}
},
Self::CosineDistance(lhs, rhs, max) => {
if let FilterExpression::Parameter(parameter) = max {
parameter.convert_to_parameter_type(ParameterType::F64)?;
Expand Down
68 changes: 68 additions & 0 deletions apps/hash-graph/openapi/openapi.json

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import execa from "execa";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export const monorepoRootDirPath = path.resolve(__dirname, "../../../../..");
export const monorepoRootDirPath = path.resolve(__dirname, "../../../../../..");

type YarnWorkspaceInfo = {
location: string;
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions libs/@local/repo-chores/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cargo-features = ["edition2024"]

[package]
name = "repo-chores"
authors.workspace = true
edition.workspace = true
version = "0.0.0"
publish = false
Loading

0 comments on commit c949304

Please sign in to comment.