Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove flyteidl.core.ContainerError tests #2841

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ jobs:
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.in', 'requirements.in')) }}
# # Install vcpkg for installing OpenSSL
# - name: Set up vcpkg
# if: runner.os == 'Windows'
# # The `openssl-sys` crate will automatically detect OpenSSL installations via Homebrew on macOS and vcpkg on Windows.
# run: |
# git clone --depth 1 https://github.com/microsoft/vcpkg.git
# cd vcpkg
# .\bootstrap-vcpkg.bat
# - name: Install OpenSSL
# if: runner.os == 'Windows'
# run: |
# cd vcpkg
# .\vcpkg install openssl
# .\vcpkg integrate install
- name: Install dependencies
run: |
pip install uv maturin
Expand Down
12 changes: 0 additions & 12 deletions tests/flytekit/unit/core/test_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,15 +662,3 @@ def test_lims():
# test an artifact with 11 partition keys
with pytest.raises(ValueError):
Artifact(name="test artifact", time_partitioned=True, partition_keys=[f"key_{i}" for i in range(11)])

@pytest.mark.flyteidl_rust
def test_cloudpickle():
a1_b = Artifact(name="my_data", partition_keys=["b"])

spec = a1_b(b="my_b_value")
import cloudpickle
# TODO: Check https://github.com/PyO3/pyo3/issues/100 for details on supporting pickle serialization in PyO3.
d = cloudpickle.dumps(spec)
spec2 = cloudpickle.loads(d)

assert spec2.partitions.b.value.static_value == "my_b_value"
16 changes: 0 additions & 16 deletions tests/flytekit/unit/core/test_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@
from flytekit.core.workflow import workflow
from flytekit.models.types import LiteralType, SimpleType

@pytest.mark.flyteidl_rust
def test_proto():
@task
def t1(in1: flyteidl.core.ContainerError) -> flyteidl.core.ContainerError:
e2 = flyteidl.core.ContainerError(code=in1.code, message=in1.message + "!!!", kind=in1.kind + 1)
return e2

@workflow
def wf(a: flyteidl.core.ContainerError) -> flyteidl.core.ContainerError:
return t1(in1=a)

e1 = flyteidl.core.ContainerError(code="test", message="hello world", kind=1)
e_out = wf(a=e1)
assert e_out.kind == 2
assert e_out.message == "hello world!!!"

@pytest.mark.flyteidl_rust
def test_pb_guess_python_type():
artifact_tag = flyteidl.core.CatalogArtifactTag(artifact_id="artifact_1", name="artifact_name")
Expand Down
25 changes: 0 additions & 25 deletions tests/flytekit/unit/core/test_type_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,31 +621,6 @@ def test_list_transformer():
xx = TypeEngine.to_python_value(ctx, lit, typing.List[int])
assert xx == [3, 4]

@pytest.mark.flyteidl_rust
def test_protos():
ctx = FlyteContext.current_context()
import flyteidl_rust as flyteidl
pb = flyteidl.core.ContainerError(code="code", message="message")
lt = TypeEngine.to_literal_type(flyteidl.core.ContainerError)
assert isinstance(lt.blob.to_flyte_idl(), flyteidl.core.BlobType)
assert lt.metadata["python_class_name"] == "<class 'builtins.ContainerError'>"
# TODO: Check https://github.com/PyO3/pyo3/issues/100 for details on supporting pickle serialization in PyO3.
lit = TypeEngine.to_literal(ctx, pb, flyteidl.core.ContainerError, lt)
new_python_val = TypeEngine.to_python_value(ctx, lit, flyteidl.core.ContainerError)
assert new_python_val == pb

# Test error
l0 = Literal(scalar=Scalar(primitive=Primitive(integer=4)))
with pytest.raises(AssertionError):
TypeEngine.to_python_value(ctx, l0, flyteidl.core.ContainerError)

default_proto = flyteidl.core.ContainerError()
lit = TypeEngine.to_literal(ctx, default_proto, flyteidl.core.ContainerError, lt)
assert lit.scalar
assert lit.scalar.generic is not None
new_python_val = TypeEngine.to_python_value(ctx, lit, flyteidl.core.ContainerError)
assert new_python_val == default_proto


def test_guessing_basic():
b = model_types.LiteralType(simple=model_types.SimpleType.BOOLEAN)
Expand Down
Loading