Skip to content

Commit

Permalink
Change license for more tests to 2024 (#1362)
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Krishna <[email protected]>
  • Loading branch information
sfc-gh-nkrishna authored Apr 4, 2024
1 parent 2b6528d commit 96da8e9
Show file tree
Hide file tree
Showing 59 changed files with 76 additions and 71 deletions.
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import logging
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_cte.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import re
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_dataframe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import copy
import datetime
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_query_history.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/test_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import decimal
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/files/udf_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#


Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_agg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import math
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_column_names.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import pytest

Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import snowflake.snowpark.mock._constants
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_stage_registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import io
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_to_pandas.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import datetime
import decimal
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/test_udf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import os
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import os

Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_create_df_from_pandas.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import datetime
import decimal
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_filter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import math
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import datetime
import math
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_oob_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import json
import logging
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_sort.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_unit/test_union.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/perf/long_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import argparse
Expand Down
2 changes: 1 addition & 1 deletion tests/perf/perf_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import argparse
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from unittest import mock
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/mock_module.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scala/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
2 changes: 1 addition & 1 deletion tests/unit/scala/test_datatype_suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.snowpark.types import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scala/test_df_suite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.snowpark.relational_grouped_dataframe import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scala/test_error_message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.snowpark._internal.error_message import SnowparkClientExceptionMessages
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scala/test_expression_and_plan_node_suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scala/test_utils_suite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import logging
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_analyzer_util_suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_code_generation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import math
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_column.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.snowpark import Column
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cte.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from unittest import mock
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_dataframe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from unittest import mock
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_datatype_mapper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import datetime
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_error_message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.connector import OperationalError, ProgrammingError
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_expression_dependent_columns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_expressions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import datetime
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_file_operation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from snowflake.snowpark import GetResult, PutResult
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from functools import partial
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_function.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import inspect
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_generated_udf_lock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import threading
Expand Down
31 changes: 18 additions & 13 deletions tests/unit/test_open_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#!/usr/bin/env python3
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import functools
import inspect
import os
import time
from unittest import mock

import snowflake.snowpark.session

from snowflake.snowpark._internal.server_connection import ServerConnection
from snowflake.snowpark._internal.open_telemetry import (
decorator_count,
build_method_chain,
)
from opentelemetry import trace
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter

import snowflake.snowpark.session
from snowflake.snowpark._internal.open_telemetry import (
build_method_chain,
decorator_count,
)
from snowflake.snowpark._internal.server_connection import ServerConnection


def spans_to_dict(spans):
res = {}
Expand All @@ -46,8 +45,10 @@ def dummy_function2():
return


api_calls = [{'name': 'Session.create_dataframe[values]'},
{'name': 'DataFrame.to_df', 'subcalls': [{'name': 'DataFrame.select'}]}]
api_calls = [
{"name": "Session.create_dataframe[values]"},
{"name": "DataFrame.to_df", "subcalls": [{"name": "DataFrame.select"}]},
]

resource = Resource(attributes={SERVICE_NAME: "snowpark-python-open-telemetry"})
trace_provider = TracerProvider(resource=resource)
Expand All @@ -71,7 +72,9 @@ def test_open_telemetry_span_from_dataframe_writer_and_dataframe():
assert "DataFrameWriter.save_as_table" in spans
span = spans["DataFrameWriter.save_as_table"]
assert span.attributes["method.chain"] == "DataFrame.to_df().save_as_table()"
assert os.path.basename(span.attributes["code.filepath"]) == "test_open_telemetry.py"
assert (
os.path.basename(span.attributes["code.filepath"]) == "test_open_telemetry.py"
)
assert span.attributes["code.lineno"] == lineno
dict_exporter.clear()

Expand All @@ -89,7 +92,9 @@ def test_open_telemetry_span_from_dataframe_writer():
assert "DataFrame.collect" in spans
span = spans["DataFrame.collect"]
assert span.attributes["method.chain"] == "DataFrame.to_df().collect()"
assert os.path.basename(span.attributes["code.filepath"]) == "test_open_telemetry.py"
assert (
os.path.basename(span.attributes["code.filepath"]) == "test_open_telemetry.py"
)
assert span.attributes["code.lineno"] == lineno


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_packaging_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import os
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_pandas_to_df.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

from unittest import mock
Expand Down
Loading

0 comments on commit 96da8e9

Please sign in to comment.