Skip to content

Commit

Permalink
chore(license): add license header to python files (#12423)
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
Co-authored-by: xxchan <[email protected]>
  • Loading branch information
wangrunji0408 and xxchan authored Sep 20, 2023
1 parent 8431a44 commit 7192a90
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ header:

paths:
- "src/**/*.rs"
- "src/**/*.py"
- "src/**/*.html"
- "dashboard/**/*.js"
- "dashboard/**/*.ts"
- "src/**/*.html"
- "java/**/*.java"
- "java/**/*.py"

Expand Down
14 changes: 14 additions & 0 deletions e2e_test/udf/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import socket
import struct
import sys
Expand Down
23 changes: 19 additions & 4 deletions src/java_binding/gen-demo-insert-data.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys


def gen_row(index):
v1 = int(index)
v2 = int(index)
v3 = int(index)
v4 = float(index)
v5 = float(index)
v6 = index % 3 == 0
v7 = '\'' + str(index) * ((index % 10) + 1) + '\''
v7 = "'" + str(index) * ((index % 10) + 1) + "'"
v8 = "to_timestamp(" + str(index) + ")"
v9 = index
may_null = None if index % 5 == 0 else int(index)
row_data = [v1, v2, v3, v4, v5, v6, v7, v8, v9, may_null]
repr = [str(o) if o is not None else 'null' for o in row_data]
return '(' + ', '.join(repr) + ')'
repr = [str(o) if o is not None else "null" for o in row_data]
return "(" + ", ".join(repr) + ")"


data_size = int(sys.argv[1])
data = [gen_row(i) for i in range(data_size)]
print(', '.join(data))
print(", ".join(data))
13 changes: 13 additions & 0 deletions src/udf/python/risingwave/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
14 changes: 14 additions & 0 deletions src/udf/python/risingwave/test_udf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from multiprocessing import Process
import pytest
from risingwave.udf import udf, UdfServer, _to_data_type
Expand Down
14 changes: 14 additions & 0 deletions src/udf/python/risingwave/udf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import *
import pyarrow as pa
import pyarrow.flight
Expand Down
14 changes: 14 additions & 0 deletions src/udf/python/risingwave/udf/health_check.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 RisingWave Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyarrow.flight import FlightClient
import sys

Expand Down

0 comments on commit 7192a90

Please sign in to comment.