Skip to content

Commit

Permalink
query_offline: Add use_v2 param (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-nambiar authored Oct 13, 2024
1 parent 1615353 commit e115fc0
Show file tree
Hide file tree
Showing 32 changed files with 1,861 additions and 479 deletions.
3 changes: 3 additions & 0 deletions fennel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [1.5.38] - 2024-10-13
- Add support for use_v2 in query_offline.

## [1.5.37] - 2024-10-10
- Support date and datetime types in Min and Max aggregations

Expand Down
2 changes: 2 additions & 0 deletions fennel/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ def query_offline(
input_s3: Optional[S3Connector] = None,
output_s3: Optional[S3Connector] = None,
feature_to_column_map: Optional[Dict[Feature, str]] = None,
use_v2: bool = False,
) -> Dict[str, Any]:
"""Extract point in time correct values of output features.
Expand Down Expand Up @@ -608,6 +609,7 @@ def query_offline(
"input": extract_historical_input,
"timestamp_column": timestamp_column,
"s3_output": _s3_connector_dict(output_s3) if output_s3 else None,
"use_v2": use_v2,
}
response = self._post_json(
"{}/query_offline".format(
Expand Down
2 changes: 1 addition & 1 deletion fennel/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from fennel_data_lib import assign, type_of, matches

import fennel.gen.schema_pb2 as schema_proto
import fennel.gen.expr_pb2 as expr_proto
import fennel.gen.expression_pb2 as expr_proto
from fennel.internal_lib.schema import (
get_datatype,
cast_col_to_arrow_dtype,
Expand Down
2 changes: 1 addition & 1 deletion fennel/expr/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fennel.dtypes.dtypes import FENNEL_STRUCT

from .visitor import Visitor
import fennel.gen.expr_pb2 as proto
import fennel.gen.expression_pb2 as proto
from fennel.internal_lib.schema import get_datatype

from fennel.expr.expr import (
Expand Down
2 changes: 1 addition & 1 deletion fennel/expr/test_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from fennel.expr.visitor import ExprPrinter, FetchReferences
from fennel.expr.serializer import ExprSerializer
from google.protobuf.json_format import ParseDict # type: ignore
from fennel.gen.expr_pb2 import Expr
from fennel.gen.expression_pb2 import Expr
from fennel.internal_lib.utils.utils import is_user_defined_class
from fennel.testing.test_utils import error_message

Expand Down
2 changes: 1 addition & 1 deletion fennel/expr/test_invalid_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from fennel.expr.visitor import ExprPrinter, FetchReferences
from fennel.expr.serializer import ExprSerializer
from google.protobuf.json_format import ParseDict # type: ignore
from fennel.gen.expr_pb2 import Expr
from fennel.gen.expression_pb2 import Expr
from fennel.testing.test_utils import error_message


Expand Down
17 changes: 8 additions & 9 deletions fennel/gen/auth_pb2.py

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

205 changes: 102 additions & 103 deletions fennel/gen/connector_pb2.py

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions fennel/gen/connector_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ database
"""
import builtins
import collections.abc
import expr_pb2
import expression_pb2
import google.protobuf.descriptor
import google.protobuf.duration_pb2
import google.protobuf.internal.containers
Expand Down Expand Up @@ -305,6 +305,7 @@ class MySQL(google.protobuf.message.Message):
database: builtins.str
port: builtins.int
jdbc_params: builtins.str
"""Next id: 9"""
def __init__(
self,
*,
Expand Down Expand Up @@ -348,6 +349,7 @@ class Postgres(google.protobuf.message.Message):
database: builtins.str
port: builtins.int
jdbc_params: builtins.str
"""Next id: 9"""
def __init__(
self,
*,
Expand Down Expand Up @@ -385,6 +387,7 @@ class S3(google.protobuf.message.Message):
@property
def aws_access_key_id_secret(self) -> secret_pb2.SecretRef: ...
role_arn: builtins.str
"""Next id: 6"""
def __init__(
self,
*,
Expand Down Expand Up @@ -418,6 +421,7 @@ class Bigquery(google.protobuf.message.Message):
def service_account_key_secret(self) -> secret_pb2.SecretRef: ...
dataset_id: builtins.str
project_id: builtins.str
"""Next id: 5"""
def __init__(
self,
*,
Expand Down Expand Up @@ -456,6 +460,7 @@ class Snowflake(google.protobuf.message.Message):
warehouse: builtins.str
role: builtins.str
database: builtins.str
"""Next id: 10"""
def __init__(
self,
*,
Expand Down Expand Up @@ -502,6 +507,7 @@ class Kafka(google.protobuf.message.Message):
sasl_mechanism: builtins.str
sasl_jaas_config: builtins.str
group_id: builtins.str
"""Next id: 10"""
def __init__(
self,
*,
Expand Down Expand Up @@ -640,6 +646,7 @@ class Mongo(google.protobuf.message.Message):
def password_secret(self) -> secret_pb2.SecretRef: ...
host: builtins.str
database: builtins.str
"""Next id: 7"""
def __init__(
self,
*,
Expand Down Expand Up @@ -670,6 +677,7 @@ class PubSub(google.protobuf.message.Message):
@property
def service_account_key_secret(self) -> secret_pb2.SecretRef: ...
project_id: builtins.str
"""Next id: 4"""
def __init__(
self,
*,
Expand Down Expand Up @@ -1010,14 +1018,14 @@ class PreProcValue(google.protobuf.message.Message):
@property
def schema(self) -> schema_pb2.Schema: ...
@property
def expr(self) -> expr_pb2.Expr: ...
def expr(self) -> expression_pb2.Expr: ...
@property
def pycode(self) -> pycode_pb2.PyCode: ...
def __init__(
self,
*,
schema: schema_pb2.Schema | None = ...,
expr: expr_pb2.Expr | None = ...,
expr: expression_pb2.Expr | None = ...,
pycode: pycode_pb2.PyCode | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["eval_type", b"eval_type", "expr", b"expr", "pycode", b"pycode", "schema", b"schema"]) -> builtins.bool: ...
Expand Down
181 changes: 90 additions & 91 deletions fennel/gen/dataset_pb2.py

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions fennel/gen/dataset_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ isort:skip_file
"""
import builtins
import collections.abc
import expr_pb2
import expression_pb2
import google.protobuf.descriptor
import google.protobuf.duration_pb2
import google.protobuf.internal.containers
Expand Down Expand Up @@ -472,7 +472,7 @@ class FilterExpr(google.protobuf.message.Message):
OPERAND_NAME_FIELD_NUMBER: builtins.int
operand_id: builtins.str
@property
def expr(self) -> expr_pb2.Expr: ...
def expr(self) -> expression_pb2.Expr: ...
operand_name: builtins.str
"""NOTE: FOLLOWING PROPERTIES ARE SET BY THE SERVER AND WILL BE IGNORED BY
THE CLIENT
Expand All @@ -481,7 +481,7 @@ class FilterExpr(google.protobuf.message.Message):
self,
*,
operand_id: builtins.str = ...,
expr: expr_pb2.Expr | None = ...,
expr: expression_pb2.Expr | None = ...,
operand_name: builtins.str = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["expr", b"expr"]) -> builtins.bool: ...
Expand Down Expand Up @@ -560,12 +560,12 @@ class AssignExpr(google.protobuf.message.Message):
VALUE_FIELD_NUMBER: builtins.int
key: builtins.str
@property
def value(self) -> expr_pb2.Expr: ...
def value(self) -> expression_pb2.Expr: ...
def __init__(
self,
*,
key: builtins.str = ...,
value: expr_pb2.Expr | None = ...,
value: expression_pb2.Expr | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["value", b"value"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ...
Expand Down Expand Up @@ -594,7 +594,7 @@ class AssignExpr(google.protobuf.message.Message):
OPERAND_NAME_FIELD_NUMBER: builtins.int
operand_id: builtins.str
@property
def exprs(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, expr_pb2.Expr]: ...
def exprs(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, expression_pb2.Expr]: ...
@property
def output_types(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, schema_pb2.DataType]: ...
operand_name: builtins.str
Expand All @@ -605,7 +605,7 @@ class AssignExpr(google.protobuf.message.Message):
self,
*,
operand_id: builtins.str = ...,
exprs: collections.abc.Mapping[builtins.str, expr_pb2.Expr] | None = ...,
exprs: collections.abc.Mapping[builtins.str, expression_pb2.Expr] | None = ...,
output_types: collections.abc.Mapping[builtins.str, schema_pb2.DataType] | None = ...,
operand_name: builtins.str = ...,
) -> None: ...
Expand Down
21 changes: 10 additions & 11 deletions fennel/gen/expectations_pb2.py

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

Loading

0 comments on commit e115fc0

Please sign in to comment.