Skip to content
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ pip install salesforce-data-customcode
datacustomcode init my_package
```

To create a package of type function, pass the parameter `--code-type=function` with the init command.

This will yield all necessary files to get started:
```
.
Expand Down Expand Up @@ -244,6 +246,8 @@ Initialize a new development environment with a code package template.

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


#### `datacustomcode scan`
Expand Down Expand Up @@ -293,6 +297,7 @@ Options:
- `--description TEXT`: Description of the transformation job (default: "")
- `--network TEXT`: docker network (default: "default")
- `--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)
- `--function-invoke-opt TEXT`: Currently we support only `UnstructuredChunking` for functions.


## Docker usage
Expand Down
18 changes: 0 additions & 18 deletions src/datacustomcode/templates/function/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/emr-on-eks/spark/emr-7.3.0:latest
FROM python:3.11-slim

USER root

Expand Down
86 changes: 0 additions & 86 deletions src/datacustomcode/templates/function/account.ipynb

This file was deleted.

This file was deleted.

This file was deleted.

97 changes: 0 additions & 97 deletions src/datacustomcode/templates/function/jupyterlab.sh

This file was deleted.

6 changes: 3 additions & 3 deletions src/datacustomcode/templates/function/payload/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def chunk_text(text: str, chunk_size: int = 1000) -> List[str]:
return chunks


def dc_function(request: dict) -> dict:
logger.info("Inside DC Function")
def function(request: dict) -> dict:
logger.info("Inside Function")
logger.info(request)

items = request["input"]
Expand Down Expand Up @@ -107,7 +107,7 @@ def dc_function(request: dict) -> dict:
}

# Run the function
result = dc_function(test_request)
result = function(test_request)

# Print the results in a more readable format
print("\nChunking Results:")
Expand Down
7 changes: 0 additions & 7 deletions src/datacustomcode/templates/function/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Required packages for the project - Do not modify
salesforce-cdp-connector>=1.0.16
pyspark==3.5.1
pandas
numpy
pydantic
jupyterlab
ipywidgets
tqdm
salesforce-data-customcode
Loading