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

Fix Snowflake Agent Bug #2605

Merged
merged 38 commits into from
Jul 31, 2024
Merged

Fix Snowflake Agent Bug #2605

merged 38 commits into from
Jul 31, 2024

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Jul 24, 2024

Tracking issue

flyteorg/flyte#3936

Why are the changes needed?

What changes were proposed in this pull request?

We want to support workflow like this.

from flytekit import kwtypes, workflow, task, ImageSpec, StructuredDataset
from flytekitplugins.snowflake import SnowflakeConfig, SnowflakeTask
from flytekit import Secret
import pandas as pd

flytekit_hash = "0c6fe09884849752cd77a9988a4b2bdc63980b7e"
flytekit = f"git+https://github.com/flyteorg/flytekit.git@{flytekit_hash}"
snowflake_plugins = f"git+https://github.com/flyteorg/flytekit.git@{flytekit_hash}#subdirectory=plugins/flytekit-snowflake"

image = ImageSpec(
    packages=[flytekit, snowflake_plugins, "pandas"],
    apt_packages=["git"],
    registry="localhost:30000",
)

"""
Define a Snowflake task to insert data into the FLYTEAGENT.PUBLIC.TEST table.
The `inputs` parameter specifies the types of the inputs using `kwtypes`.
The `query_template` uses Python string interpolation to insert these inputs into the SQL query.
The placeholders `%(id)s`, `%(name)s`, and `%(age)s` will be replaced by the actual values
provided when the task is executed.
"""

snowflake_task_insert_query = SnowflakeTask(
    name="insert-dynamic-query",
    inputs=kwtypes(id=int, name=str, age=int),
    task_config=SnowflakeConfig(
        account="WNITKUT-UJ60052",
        user="HANRU",
        database="FLYTEAGENT",
        schema="PUBLIC",
        warehouse="COMPUTE_WH",
        table="FLYTEAGENT.PUBLIC.TEST",
    ),
    query_template="""
            INSERT INTO FLYTEAGENT.PUBLIC.TEST (ID, NAME, AGE)
            VALUES (%(id)s, %(name)s, %(age)s);
            """,
)

snowflake_task_templatized_query = SnowflakeTask(
    name="test-simple-query",
    output_schema_type=StructuredDataset,
    # Define inputs as well as their types that can be used to customize the query.
    # inputs=kwtypes(nation_key=int),
    task_config=SnowflakeConfig(
        account="WNITKUT-UJ60052",
        user="HANRU",
        database="FLYTEAGENT",
        schema="PUBLIC",
        warehouse="COMPUTE_WH",
        table="FLYTEAGENT.PUBLIC.TEST",
    ),
    query_template="SELECT * FROM FLYTEAGENT.PUBLIC.TEST LIMIT 1;",
)

@task(container_image=image, secret_requests=[Secret(
      group="snowflake",
      key="private_key",)])
def print_head(input_sd: StructuredDataset) -> pd.DataFrame:
    df = input_sd.open(pd.DataFrame).all()
    print(df)
    return df


@task(container_image=image, secret_requests=[Secret(
      group="snowflake",
      key="private_key",)])
def write_table() -> StructuredDataset:
    df = pd.DataFrame({
        "ID": [1, 2, 3],
        "NAME": ["union", "union", "union"],
        "AGE": [30, 30, 30]
    })
    print(df)
    return StructuredDataset(dataframe=df, uri="snowflake://HANRU/WNITKUT-UJ60052/COMPUTE_WH/FLYTEAGENT/PUBLIC/TEST")

@workflow
def wf() -> StructuredDataset:
    sd = snowflake_task_templatized_query()
    t1 = print_head(input_sd=sd)
    insert_query = snowflake_task_insert_query(id=1, name="Flyte", age=30)
    sd2 = snowflake_task_templatized_query()

    sd >> t1 >> insert_query >> sd2
    write_table()
    return print_head(input_sd=sd2)


if __name__ == "__main__":
    print(f"Running {__file__} main...")
    wf()
    print("Done!")

How was this patch tested?

Setup process

Screenshots

local execution:
image

remote execution:
image

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

#1811

Docs link

@Future-Outlier
Copy link
Member Author

example:

from flytekit import kwtypes, workflow, StructuredDataset
from flytekitplugins.snowflake import SnowflakeConfig, SnowflakeTask

snowflake_task_templatized_query = SnowflakeTask(
    name="test-simple-query",
    # inputs={},
    output_schema_type=StructuredDataset,

    # Define inputs as well as their types that can be used to customize the query.
    # inputs=kwtypes(nation_key=int),
    task_config=SnowflakeConfig(
        account="WNITKUT-UJ60052",
        user="HANRU",
        database="FLYTEAGENT",
        schema="PUBLIC",
        warehouse="COMPUTE_WH",
    ),
    # query_template="SELECT 1"
    query_template="SELECT * FROM FLYTEAGENT.PUBLIC.TEST;",
)

if __name__ == "__main__":
    sd = snowflake_task_templatized_query()
    print(sd)
    # print(snowflake_task_no_io())
    # print(snowflake_wf(nation_key=10))

@fiedlerNr9
Copy link
Contributor

Thats amazing work!

When reading the StructuredDataset in another task, I stumbled upon snowflake protocol not being supported:

from flytekit import kwtypes, workflow, task, ImageSpec, StructuredDataset
from flytekitplugins.snowflake import SnowflakeConfig, SnowflakeTask
import pandas as pd

snowflake_task_no_io = SnowflakeTask(
    name="something",
    inputs=kwtypes(x=int),
    query_template="SELECT * FROM JANTEST.PUBLIC.PEOPLE LIMIT 2;",
    output_schema_type=StructuredDataset,
    task_config=SnowflakeConfig(
        user="FIEDLERNR9",
        account="FJTBLYP-JK84112",
        database="JANTEST",
        schema="PUBLIC",
        warehouse="COMPUTE_WH",
    ),
)

@task
def print_head(input_sd: StructuredDataset):
    df = input_sd.open(pd.DataFrame).all()
    print(df)


@workflow
def wf():
    sd = snowflake_task_no_io(x=1)
    print_head(input_sd=sd)

full stacktrace:

pyflyte run test_snowflake.py wf
Running Execution on local.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/exceptions/scopes.py:242  │
│ in user_entry_point                                                                              │
│                                                                                                  │
│   239 │   │   │   │   │   raise type(exc)(f"Error encountered while executing '{fn_name}':\n     │
│   240 │   │   else:                                                                              │
│   241 │   │   │   try:                                                                           │
│ ❱ 242 │   │   │   │   return wrapped(*args, **kwargs)                                            │
│   243 │   │   │   except FlyteScopedException as scoped:                                         │
│   244 │   │   │   │   raise scoped                                                               │
│   245 │   │   │   except _user_exceptions.FlyteUserException:                                    │
│                                                                                                  │
│ /Users/janfiedler/Documents/Customers/Fortune-Brands/plugin-test/test_snowflake.py:38 in         │
│ print_head                                                                                       │
│                                                                                                  │
│   35                                                                                             │
│   36 @task                                                                                       │
│   37 def print_head(input_sd: StructuredDataset):                                                │
│ ❱ 38 │   df = input_sd.open(pd.DataFrame).all()                                                  │
│   39 │   print(df)                                                                               │
│   40                                                                                             │
│   41                                                                                             │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/types/structured/structur │
│ ed_dataset.py:141 in all                                                                         │
│                                                                                                  │
│   138 │   │   if self._dataframe_type is None:                                                   │
│   139 │   │   │   raise ValueError("No dataframe type set. Use open() to set the local datafra   │
│   140 │   │   ctx = FlyteContextManager.current_context()                                        │
│ ❱ 141 │   │   return flyte_dataset_transformer.open_as(ctx, self.literal, self._dataframe_type   │
│   142 │                                                                                          │
│   143 │   def iter(self) -> Generator[DF, None, None]:                                           │
│   144 │   │   if self._dataframe_type is None:                                                   │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/types/structured/structur │
│ ed_dataset.py:854 in open_as                                                                     │
│                                                                                                  │
│   851 │   │   """                                                                                │
│   852 │   │   protocol = get_protocol(sd.uri)                                                    │
│   853 │   │   decoder = self.get_decoder(df_type, protocol, sd.metadata.structured_dataset_typ   │
│ ❱ 854 │   │   result = decoder.decode(ctx, sd, updated_metadata)                                 │
│   855 │   │   if isinstance(result, types.GeneratorType):                                        │
│   856 │   │   │   raise ValueError(f"Decoder {decoder} returned iterator {result} but whole va   │
│   857 │   │   return result                                                                      │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/types/structured/basic_df │
│ s.py:137 in decode                                                                               │
│                                                                                                  │
│   134 │   │   if current_task_metadata.structured_dataset_type and current_task_metadata.struc   │
│   135 │   │   │   columns = [c.name for c in current_task_metadata.structured_dataset_type.col   │
│   136 │   │   try:                                                                               │
│ ❱ 137 │   │   │   return pd.read_parquet(uri, columns=columns, storage_options=kwargs)           │
│   138 │   │   except NoCredentialsError:                                                         │
│   139 │   │   │   logger.debug("S3 source detected, attempting anonymous S3 access")             │
│   140 │   │   │   kwargs = get_pandas_storage_options(uri=uri, data_config=ctx.file_access.dat   │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/pandas/io/parquet.py:667 in        │
│ read_parquet                                                                                     │
│                                                                                                  │
│   664 │   │   use_nullable_dtypes = False                                                        │
│   665 │   check_dtype_backend(dtype_backend)                                                     │
│   666 │                                                                                          │
│ ❱ 667 │   return impl.read(                                                                      │
│   668 │   │   path,                                                                              │
│   669 │   │   columns=columns,                                                                   │
│   670 │   │   filters=filters,                                                                   │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/pandas/io/parquet.py:267 in read   │
│                                                                                                  │
│   264 │   │   if manager == "array":                                                             │
│   265 │   │   │   to_pandas_kwargs["split_blocks"] = True  # type: ignore[assignment]            │
│   266 │   │                                                                                      │
│ ❱ 267 │   │   path_or_handle, handles, filesystem = _get_path_or_handle(                         │
│   268 │   │   │   path,                                                                          │
│   269 │   │   │   filesystem,                                                                    │
│   270 │   │   │   storage_options=storage_options,                                               │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/pandas/io/parquet.py:122 in        │
│ _get_path_or_handle                                                                              │
│                                                                                                  │
│   119 │   │   │   │   pass                                                                       │
│   120 │   │   if fs is None:                                                                     │
│   121 │   │   │   fsspec = import_optional_dependency("fsspec")                                  │
│ ❱ 122 │   │   │   fs, path_or_handle = fsspec.core.url_to_fs(                                    │
│   123 │   │   │   │   path_or_handle, **(storage_options or {})                                  │
│   124 │   │   │   )                                                                              │
│   125 │   elif storage_options and (not is_url(path_or_handle) or mode != "rb"):                 │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/fsspec/core.py:396 in url_to_fs    │
│                                                                                                  │
│   393 │   │   "num",                                                                             │
│   394 │   }                                                                                      │
│   395 │   kwargs = {k: v for k, v in kwargs.items() if k not in known_kwargs}                    │
│ ❱ 396 │   chain = _un_chain(url, kwargs)                                                         │
│   397 │   inkwargs = {}                                                                          │
│   398 │   # Reverse iterate the chain, creating a nested target_* structure                      │
│   399 │   for i, ch in enumerate(reversed(chain)):                                               │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/fsspec/core.py:344 in _un_chain    │
│                                                                                                  │
│   341 │   kwargs = kwargs.copy()                                                                 │
│   342 │   for bit in reversed(bits):                                                             │
│   343 │   │   protocol = kwargs.pop("protocol", None) or split_protocol(bit)[0] or "file"        │
│ ❱ 344 │   │   cls = get_filesystem_class(protocol)                                               │
│   345 │   │   extra_kwargs = cls._get_kwargs_from_urls(bit)                                      │
│   346 │   │   kws = kwargs.pop(protocol, {})                                                     │
│   347 │   │   if bit is bits[0]:                                                                 │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/fsspec/registry.py:239 in          │
│ get_filesystem_class                                                                             │
│                                                                                                  │
│   236 │                                                                                          │
│   237 │   if protocol not in registry:                                                           │
│   238 │   │   if protocol not in known_implementations:                                          │
│ ❱ 239 │   │   │   raise ValueError(f"Protocol not known: {protocol}")                            │
│   240 │   │   bit = known_implementations[protocol]                                              │
│   241 │   │   try:                                                                               │
│   242 │   │   │   register_implementation(protocol, _import_class(bit["class"]))                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Protocol not known: snowflake

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/exceptions/scopes.py:217  │
│ in user_entry_point                                                                              │
│                                                                                                  │
│   214 │   │   │   # See comment at this location for system_entry_point                          │
│   215 │   │   │   fn_name = wrapped.__name__                                                     │
│   216 │   │   │   try:                                                                           │
│ ❱ 217 │   │   │   │   return wrapped(*args, **kwargs)                                            │
│   218 │   │   │   except FlyteScopedException as exc:                                            │
│   219 │   │   │   │   raise exc.type(f"Error encountered while executing '{fn_name}':\n  {exc.   │
│   220 │   │   │   except Exception as exc:                                                       │
│                                                                                                  │
│ /Users/janfiedler/Documents/Customers/Fortune-Brands/plugin-test/test_snowflake.py:46 in wf      │
│                                                                                                  │
│   43 def wf():                                                                                   │
│   44 │   sd = snowflake_task_no_io(x=1)                                                          │
│   45 │   # print(sd)                                                                             │
│ ❱ 46 │   print_head(input_sd=sd)                                                                 │
│   47                                                                                             │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/base_task.py:358 in  │
│ __call__                                                                                         │
│                                                                                                  │
│   355 │   │   return create_task_output(vals, self.python_interface)                             │
│   356 │                                                                                          │
│   357 │   def __call__(self, *args: object, **kwargs: object) -> Union[Tuple[Promise], Promise   │
│ ❱ 358 │   │   return flyte_entity_call_handler(self, *args, **kwargs)  # type: ignore            │
│   359 │                                                                                          │
│   360 │   def compile(self, ctx: FlyteContext, *args, **kwargs):                                 │
│   361 │   │   raise Exception("not implemented")                                                 │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/promise.py:1248 in   │
│ flyte_entity_call_handler                                                                        │
│                                                                                                  │
│   1245 │   │   │   │   │   return create_task_output(vals, entity.python_interface)              │
│   1246 │   │   │   │   else:                                                                     │
│   1247 │   │   │   │   │   return None                                                           │
│ ❱ 1248 │   │   │   return cast(LocallyExecutable, entity).local_execute(ctx, **kwargs)           │
│   1249 │   else:                                                                                 │
│   1250 │   │   mode = cast(LocallyExecutable, entity).local_execution_mode()                     │
│   1251 │   │   omt = OutputMetadataTracker()                                                     │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/base_task.py:335 in  │
│ local_execute                                                                                    │
│                                                                                                  │
│   332 │   │   │   # This code should mirror the call to `sandbox_execute` in the above cache c   │
│   333 │   │   │   # Code is simpler with duplication and less metaprogramming, but introduces    │
│   334 │   │   │   # if one is changed and not the other.                                         │
│ ❱ 335 │   │   │   outputs_literal_map = self.sandbox_execute(ctx, input_literal_map)             │
│   336 │   │                                                                                      │
│   337 │   │   if inspect.iscoroutine(outputs_literal_map):                                       │
│   338 │   │   │   return outputs_literal_map                                                     │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/base_task.py:415 in  │
│ sandbox_execute                                                                                  │
│                                                                                                  │
│   412 │   │   es = cast(ExecutionState, ctx.execution_state)                                     │
│   413 │   │   b = cast(ExecutionParameters, es.user_space_params).with_task_sandbox()            │
│   414 │   │   ctx = ctx.current_context().with_execution_state(es.with_params(user_space_param   │
│ ❱ 415 │   │   return self.dispatch_execute(ctx, input_literal_map)                               │
│   416 │                                                                                          │
│   417 │   @abstractmethod                                                                        │
│   418 │   def dispatch_execute(                                                                  │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/base_task.py:733 in  │
│ dispatch_execute                                                                                 │
│                                                                                                  │
│   730 │   │   │   #   a workflow or a subworkflow etc                                            │
│   731 │   │   │   logger.info(f"Invoking {self.name} with inputs: {native_inputs}")              │
│   732 │   │   │   with timeit("Execute user level code"):                                        │
│ ❱ 733 │   │   │   │   native_outputs = self.execute(**native_inputs)                             │
│   734 │   │   │                                                                                  │
│   735 │   │   │   if inspect.iscoroutine(native_outputs):                                        │
│   736 │   │   │   │   # If native outputs is a coroutine, then this is an eager workflow.        │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/core/python_function_task │
│ .py:199 in execute                                                                               │
│                                                                                                  │
│   196 │   │   handle dynamic tasks or you will no longer be able to use the task as a dynamic    │
│   197 │   │   """                                                                                │
│   198 │   │   if self.execution_mode == self.ExecutionBehavior.DEFAULT:                          │
│ ❱ 199 │   │   │   return exception_scopes.user_entry_point(self._task_function)(**kwargs)        │
│   200 │   │   elif self.execution_mode == self.ExecutionBehavior.EAGER:                          │
│   201 │   │   │   # if the task is a coroutine function, inject the context object so that the   │
│   202 │   │   │   # has access to the FlyteContext.                                              │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/exceptions/scopes.py:148  │
│ in f                                                                                             │
│                                                                                                  │
│   145 │   def inner_decorator(inner_f):                                                          │
│   146 │   │   @_wraps(inner_f)                                                                   │
│   147 │   │   def f(*args, **kwargs):                                                            │
│ ❱ 148 │   │   │   return outer_f(inner_f, args, kwargs)                                          │
│   149 │   │                                                                                      │
│   150 │   │   return f                                                                           │
│   151                                                                                            │
│                                                                                                  │
│ /opt/homebrew/anaconda3/envs/fbin/lib/python3.9/site-packages/flytekit/exceptions/scopes.py:253  │
│ in user_entry_point                                                                              │
│                                                                                                  │
│   250 │   │   │   │   # This is why this function exists - arbitrary exceptions that we don't    │
│   251 │   │   │   │   # interpreted as user exceptions.                                          │
│   252 │   │   │   │   # This will also catch FlyteUserException re-raised by the system_entry_   │
│ ❱ 253 │   │   │   │   raise FlyteScopedUserException(*_exc_info())                               │
│   254 │   finally:                                                                               │
│   255 │   │   _CONTEXT_STACK.pop()                                                               │
│   256                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FlyteScopedUserException: Protocol not known: snowflake

The above exception was the direct cause of the following exception:

ValueError: Error encountered while executing 'wf':
  Protocol not known: snowflake

@Future-Outlier
Copy link
Member Author

Future-Outlier commented Jul 25, 2024

TODO:

  1. CHECK IF table is required in snowflake
  2. FIX TESTS
  3. list things to do to improve the doc.
    (1) how to get all config you need in 1 query? It's doable in snowflake console.
    (2) add examples and also mentioned that we have to build our own image for snowflake dependency and mount the secret to read it correctly.

@Future-Outlier
Copy link
Member Author

todo: add flyte-comformance

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 7.57576% with 61 lines in your changes missing coverage. Please review.

Project coverage is 78.35%. Comparing base (eae31c0) to head (c4b641e).
Report is 13 commits behind head on master.

Files Patch % Lines
flytekit/types/structured/snowflake.py 0.00% 48 Missing ⚠️
flytekit/types/structured/__init__.py 14.28% 6 Missing ⚠️
flytekit/core/type_engine.py 0.00% 4 Missing and 1 partial ⚠️
flytekit/core/context_manager.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2605       +/-   ##
===========================================
+ Coverage   47.17%   78.35%   +31.17%     
===========================================
  Files         230      189       -41     
  Lines       21322    19110     -2212     
  Branches     3711     3719        +8     
===========================================
+ Hits        10059    14973     +4914     
+ Misses      11154     3464     -7690     
- Partials      109      673      +564     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pingsutw and others added 5 commits July 25, 2024 14:24
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
@Future-Outlier
Copy link
Member Author

We should use this

SELECT
    CURRENT_USER() AS "User",
    CONCAT(CURRENT_ORGANIZATION_NAME(), '-', CURRENT_ACCOUNT_NAME()) AS "Account",
    CURRENT_DATABASE() AS "Database",
    CURRENT_SCHEMA() AS "Schema",
    CURRENT_WAREHOUSE() AS "Warehouse";
image

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
@Future-Outlier Future-Outlier changed the title fix snowflake agent bug Fix snowflake agent bug Jul 30, 2024
@Future-Outlier Future-Outlier changed the title Fix snowflake agent bug Fix Snowflake Agent Bug Jul 30, 2024
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Comment on lines 29 to 32
if get_plugin().secret_requires_group():
pk_string = flytekit.current_context().secrets.get("private_key", "snowflake", encode_mode="r")
else:
pk_string = flytekit.current_context().secrets.get(None, "snowflake", encode_mode="r")
Copy link
Member Author

@Future-Outlier Future-Outlier Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to use the secret in the union cloud, we have to add union in our Python packages.

image = ImageSpec(
    packages=[flytekit, snowflake_plugins, "union"],
    apt_packages=["git"],
    registry="futureoutlier",
)

secret_requests=[Secret(
      group=None,
      key="snowflake",)]

If we want to use the secret in the flyte sandbox, we have to remove union in our Python packages.

image = ImageSpec(
    packages=[flytekit, snowflake_plugins,],
    apt_packages=["git"],
    registry="futureoutlier",
)
secret_requests=[Secret(
      group="private_key",
      key="snowflake",)]

Does this looks good to all of you?
cc @pingsutw @kumare3 @thomasjpfan @wild-endeavor @eapolinario @samhita-alla

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this secret file based?

I'll prefer if the user can specific the secret and then it's passed here. I only see it possible by having the user call register_snowflake_handlers:

secret = Secret(key="abc", group="xyz")

# `get_private_key` uses `secret.{key, group}` to get the secret
register_snowflake_handlers(secret=secret)

@task(secret_request=[secret])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this secret file based?
The secret is a file.

I'll prefer if the user can specific the secret and then it's passed here.
This is a problem, we haven't figured out how to make users specify the secret in a better way.
But maybe flyte connection can solve this problem in the future.

Do you think it's ok to merge this implementation now and change it's behavior by flyte connection in the future?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with flyte connection, the key and group in this PR is still hardcoded, so I do not think it resolves my concern. Is the design of flyte connection to hard code the secret key?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not right, i think we should ignore group in the SecretManager itself. Not in every plugin. this cannot scale and work universally

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @samhita-alla can you please comment and help here

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
@kumare3
Copy link
Contributor

kumare3 commented Jul 30, 2024

Lgtm - cc @thomasjpfan and @katrogan

@Future-Outlier
Copy link
Member Author

It works now
image

package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
package.json Outdated Show resolved Hide resolved
flytekit/core/type_engine.py Show resolved Hide resolved
@Future-Outlier Future-Outlier merged commit 1b67f16 into master Jul 31, 2024
47 checks passed
mao3267 pushed a commit to mao3267/flytekit that referenced this pull request Aug 1, 2024
* fix snowflake agent bug

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* a work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Snowflake work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix secret encode

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* all works, I am so happy

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* improve additional protocol

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update agent

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Add snowflake test

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* sd

Signed-off-by: Kevin Su <pingsutw@apache.org>

* snowflake loglinks

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add metadata

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* secret

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* remove table

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add comment for get private key

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments:

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Better Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use union secret

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update Changes

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use if not get_plugin().secret_requires_group()

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Use Union SDK

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* remove pacakge.json

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* lint

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add snowflake-connector-python

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix test_snowflake

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try to fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try Fix snowflake Import

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* snowflake test passed

Signed-off-by: Future-Outlier <eric901201@gmail.com>

---------

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
mao3267 pushed a commit to mao3267/flytekit that referenced this pull request Aug 2, 2024
* fix snowflake agent bug

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* a work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Snowflake work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix secret encode

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* all works, I am so happy

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* improve additional protocol

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update agent

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Add snowflake test

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* sd

Signed-off-by: Kevin Su <pingsutw@apache.org>

* snowflake loglinks

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add metadata

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* secret

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* remove table

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add comment for get private key

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments:

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Better Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use union secret

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update Changes

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use if not get_plugin().secret_requires_group()

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Use Union SDK

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* remove pacakge.json

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* lint

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add snowflake-connector-python

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix test_snowflake

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try to fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try Fix snowflake Import

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* snowflake test passed

Signed-off-by: Future-Outlier <eric901201@gmail.com>

---------

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>
Future-Outlier added a commit that referenced this pull request Aug 26, 2024
…class] (#2603)

* fix: set dataclass member as optional if default value is provided

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* lint

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* feat: handle nested dataclass conversion in JsonParamType

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: handle errors caused by NoneType default value

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* test: add nested dataclass unit tests

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Sagemaker dict determinism (#2597)

* truncate sagemaker agent outputs

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix tests and update agent output

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* lint

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix test

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add idempotence token to workflow

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix type

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix mixin

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* modify output handler

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* make the dictionary deterministic

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* nit

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

---------

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* refactor(core): Enhance return type extraction logic (#2598)

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Feat: Make exception raised by external command authenticator more actionable (#2594)

Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
Co-authored-by: Fabio Grätz <fabiogratz@googlemail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Fix: Properly re-raise non-grpc exceptions during refreshing of proxy-auth credentials in auth interceptor (#2591)

Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
Co-authored-by: Fabio Grätz <fabiogratz@googlemail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* validate idempotence token length in subsequent tasks (#2604)

* validate idempotence token length in subsequent tasks

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove redundant param

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add tests

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

---------

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Add nvidia-l4 gpu accelerator (#2608)

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* eliminate redundant literal conversion for `Iterator[JSON]` type (#2602)

* eliminate redundant literal conversion for  type

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add test

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* lint

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add isclass check

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

---------

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* [FlyteSchema] Fix numpy problems (#2619)

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* add nim plugin (#2475)

* add nim plugin

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* move nim to inference

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* import fix

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix port

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add pod_template method

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add containers

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* update

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* clean up

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove cloud import

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix extra config

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove decorator

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add tests, update readme

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add env

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add support for lora adapter

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* minor fixes

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add startup probe

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* increase failure threshold

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove ngc secret group

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* move plugin to flytekit core

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix docs

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove hf group

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* modify podtemplate import

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix import

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix ngc api key

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix tests

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix formatting

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* lint

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* docs fix

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* docs fix

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* update secrets interface

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add secret prefix

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* fix tests

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add urls

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add urls

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove urls

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* minor modifications

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* remove secrets prefix; add failure threshold

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add hard-coded prefix

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* add comment

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* make secrets prefix a required param

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* move nim to flytekit plugin

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* update readme

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* update readme

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

* update readme

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>

---------

Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* [Elastic/Artifacts] Pass through model card (#2575)

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Remove pyarrow as a direct dependency (#2228)

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Boolean flag to show local container logs to the terminal (#2521)

Signed-off-by: aditya7302 <aditya7302@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Enable Ray Fast Register (#2606)

Signed-off-by: Jan Fiedler <jan@union.ai>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* [Artifacts/Elastic] Skip partitions (#2620)

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Install flyteidl from master in plugins tests (#2621)

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Using ParamSpec to show underlying typehinting (#2617)

Signed-off-by: JackUrb <jack@datologyai.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Support ArrayNode mapping over Launch Plans (#2480)

* set up array node

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* wip array node task wrapper

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* support function like callability

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* temp check in some progress on python func wrapper

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* only support launch plans in new array node class for now

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* add map task array node implementation wrapper

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* ArrayNode only supports LPs for now

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* support local execute for new array node implementation

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* add local execute unit tests for array node

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* set exeucution version in array node spec

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* check input types for local execute

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* remove code that is un-needed for now

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* clean up array node class

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* improve naming

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* clean up

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* utilize enum execution mode to set array node execution path

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* default execution mode to FULL_STATE for new array node class

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* support min_successes for new array node

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* add map task wrapper unit test

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* set min successes for array node map task wrapper

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* update docstrings

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* Install flyteidl from master in plugins tests

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>

* lint

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* clean up min success/ratio setting

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* lint

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

* make array node class callable

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>

---------

Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Richer printing for some artifact objects (#2624)

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* ci: Add Python 3.9 to build matrix (#2622)

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* bump (#2627)

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Added alt prefix head to FlyteFile.new_remote (#2601)

* Added alt prefix head to FlyteFile.new_remote

Signed-off-by: pryce-turner <pryce.turner@gmail.com>

* Added get_new_path method to FileAccessProvider, fixed new_remote method of FlyteFile

Signed-off-by: pryce-turner <pryce.turner@gmail.com>

* Updated tests and added new path creator to FlyteFile/Dir new_remote methods

Signed-off-by: pryce-turner <pryce.turner@gmail.com>

* Improved docstrings, fixed minor path sep bug, more descriptive naming, better test

Signed-off-by: pryce-turner <pryce.turner@gmail.com>

* Formatting

Signed-off-by: pryce-turner <pryce.turner@gmail.com>

---------

Signed-off-by: pryce-turner <pryce.turner@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Feature gate for FlyteMissingReturnValueException (#2623)

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Remove use of multiprocessing from the OAuth client (#2626)

* Remove use of multiprocessing from the OAuth client

Signed-off-by: Robert Deaton <robert.deaton@freenome.com>

* Lint

Signed-off-by: Robert Deaton <robert.deaton@freenome.com>

---------

Signed-off-by: Robert Deaton <robert.deaton@freenome.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Update codespell in precommit to version 2.3.0 (#2630)

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Fix Snowflake Agent Bug (#2605)

* fix snowflake agent bug

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* a work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Snowflake work version

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix secret encode

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* all works, I am so happy

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* improve additional protocol

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update agent

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Add snowflake test

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* sd

Signed-off-by: Kevin Su <pingsutw@apache.org>

* snowflake loglinks

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add metadata

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* secret

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* remove table

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add comment for get private key

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments:

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* update comments

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Better Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use union secret

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update Changes

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* use if not get_plugin().secret_requires_group()

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Use Union SDK

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Update

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Fix Secrets

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* remove pacakge.json

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* lint

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* add snowflake-connector-python

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix test_snowflake

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try to fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix tests

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* Try Fix snowflake Import

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* snowflake test passed

Signed-off-by: Future-Outlier <eric901201@gmail.com>

---------

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* run test_missing_return_value on python 3.10+ (#2637)

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* [Elastic] Fix context usage and apply fix to fork method (#2628)

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Add flytekit-omegaconf plugin (#2299)

* add flytekit-hydra

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* fix small typo readme

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* ruff ruff

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* lint more

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* rename plugin into flytekit-omegaconf

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* lint sort imports

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* use flytekit logger

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* use flytekit logger #2

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* fix typing info in is_flatable

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* use default_factory instead of mutable default value

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* add python3.11 and python3.12 to setup.py

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* make fmt

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* define error message only once

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* add docstring

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* remove GenericEnumTransformer and tests

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* fallback to TypeEngine.get_transformer(node_type) to find suitable transformer

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* explicit valueerrors instead of asserts

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* minor style improvements

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* remove obsolete warnings

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* import flytekit logger instead of instantiating our own

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* docstrings in reST format

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* refactor transformer mode

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* improve docs

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* refactor dictconfig class into smaller methods

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* add unit tests for dictconfig transformer

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* refactor of parse_type_description()

Signed-off-by: mg515 <miha.garafolj@gmail.com>

* add omegaconf plugin to pythonbuild.yaml

---------

Signed-off-by: mg515 <miha.garafolj@gmail.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Adds extra-index-url to default image builder (#2636)

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* reference_task should inherit from PythonTask (#2643)

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Fix Get Agent Secret Using Key (#2644)

Signed-off-by: Future-Outlier <eric901201@gmail.com>
Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: prevent converting Flyte types as custom dataclasses

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: add None to output type

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* test: add unit test for nested dataclass inputs

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* test: add unit tests for nested dataclass, dataclass default value as None, and flyte type exceptions

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: handle NoneType as default value of list type dataclass members

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: add comments for `has_nested_dataclass` function

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: make lint

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* fix: update tests regarding input through file and pipe

Signed-off-by: mao3267 <chenvincent610@gmail.com>

* Make JsonParamType convert faster

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* make has_nested_dataclass func more clean and add tests for dataclass_with_optional_fields

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* make logic more backward compatible

Signed-off-by: Future-Outlier <eric901201@gmail.com>

* fix: handle indexing errors in dict/list while checking nested dataclass, add comments

Signed-off-by: mao3267 <chenvincent610@gmail.com>

---------

Signed-off-by: mao3267 <chenvincent610@gmail.com>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Future-Outlier <eric901201@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants