Skip to content

Commit d88b943

Browse files
authored
Merge pull request #75 from diksha-sf/main
Update dc_function to function
2 parents 95cf6cf + 3a51eb2 commit d88b943

File tree

9 files changed

+9
-303
lines changed

9 files changed

+9
-303
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pip install salesforce-data-customcode
4040
datacustomcode init my_package
4141
```
4242

43+
To create a package of type function, pass the parameter `--code-type=function` with the init command.
44+
4345
This will yield all necessary files to get started:
4446
```
4547
.
@@ -244,6 +246,8 @@ Initialize a new development environment with a code package template.
244246

245247
Argument:
246248
- `DIRECTORY`: Directory to create project in (default: ".")
249+
Options:
250+
- `--code-type TEXT`: This can be either `function` or `script`. The default value is `script` if the argument is missing.
247251

248252

249253
#### `datacustomcode scan`
@@ -293,6 +297,7 @@ Options:
293297
- `--description TEXT`: Description of the transformation job (default: "")
294298
- `--network TEXT`: docker network (default: "default")
295299
- `--cpu-size TEXT`: CPU size for the deployment (default: `CPU_2XL`). Available options: CPU_L(Large), CPU_XL(Extra Large), CPU_2XL(2X Large), CPU_4XL(4X Large)
300+
- `--function-invoke-opt TEXT`: Currently we support only `UnstructuredChunking` for functions.
296301

297302

298303
## Docker usage

src/datacustomcode/templates/function/Dockerfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/datacustomcode/templates/function/Dockerfile.dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/emr-on-eks/spark/emr-7.3.0:latest
1+
FROM python:3.11-slim
22

33
USER root
44

src/datacustomcode/templates/function/account.ipynb

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/datacustomcode/templates/function/examples/employee_hierarchy/employee_data.csv

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/datacustomcode/templates/function/examples/employee_hierarchy/entrypoint.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/datacustomcode/templates/function/jupyterlab.sh

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/datacustomcode/templates/function/payload/entrypoint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def chunk_text(text: str, chunk_size: int = 1000) -> List[str]:
3333
return chunks
3434

3535

36-
def dc_function(request: dict) -> dict:
37-
logger.info("Inside DC Function")
36+
def function(request: dict) -> dict:
37+
logger.info("Inside Function")
3838
logger.info(request)
3939

4040
items = request["input"]
@@ -107,7 +107,7 @@ def dc_function(request: dict) -> dict:
107107
}
108108

109109
# Run the function
110-
result = dc_function(test_request)
110+
result = function(test_request)
111111

112112
# Print the results in a more readable format
113113
print("\nChunking Results:")
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
# Required packages for the project - Do not modify
2-
salesforce-cdp-connector>=1.0.16
3-
pyspark==3.5.1
4-
pandas
5-
numpy
62
pydantic
7-
jupyterlab
8-
ipywidgets
9-
tqdm
103
salesforce-data-customcode

0 commit comments

Comments
 (0)