# entry\_point

💡Did you know\...

Available from dbt v1.11 or with the [dbt "Latest" release track](../../docs/dbt-versions/dbt-release-tracks.md).

functions/\<filename>.yml

```yml
functions:
  - name: <function name>
    config:
      entry_point: <string> # required for Snowflake and BigQuery; optional and ignored on Databricks
```

## Definition

When creating Python UDFs, specify the Python function to be called in `entry_point`.

Python UDFs are currently supported in Snowflake, BigQuery, and Databricks. Each warehouse uses a different name for the entry point function. The following table shows what they’re called:

| Warehouse  | How `entry_point` is used                                                                                                                                        |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Snowflake  | Becomes the `HANDLER` name in `LANGUAGE PYTHON UDF`                                                                                                              |
| BigQuery   | Becomes the `entry_point` in `OPTIONS(...)`                                                                                                                      |
| Databricks | Accepted for compatibility but has no effect. The function body is used directly, so dbt displays a warning if you set it. Available in `dbt-databricks` v1.12+. |

## Example

For example, if you have a Python UDF in `functions/my_function.py` with the following code which uses the function `main` as the entry point:

functions/my\_function.py

```python
import re

def _digits_only(s: str) -> bool:
    return bool(re.search(r'^[0-9]+$', s or ''))

def _to_flag(is_match: bool) -> int:
    return 1 if is_match else 0

def main(a_string: str) -> int:
    """
    This is used as the entry point for the UDF.
    Returns 1 if a_string represents a positive integer (e.g., "10"),
    else 0.
    """
    return _to_flag(_digits_only(a_string))
```

After defining the UDF, you can specify `main` as the `entry_point` in the YAML file. `entry_point: main` points to the `main` function as the entry point for the UDF, while `_digits_only` and `_to_flag` are helper functions.

functions/schema.yml

```yaml
functions:
  - name: is_positive_int
    description: Returns 1 if a_string matches ^[0-9]+$, else 0
    config:
      runtime_version: "3.11"    # required
      entry_point: main          # required: points to the function above
    arguments:
      - name: a_string
        data_type: string
    returns:
      data_type: integer
```

## Related documentation

* [User-defined functions](../../docs/build/udfs.md)
* [Function properties](../function-properties.md)
* [Function configurations](../function-configs.md)
* [type](./type.md)
* [volatility](./volatility.md)
* [runtime\_version](./runtime-version.md)
* [packages](./packages.md)
* [arguments](../resource-properties/function-arguments.md)
* [returns](../resource-properties/returns.md)

## Was this page helpful?

YesNo

[Privacy policy](https://www.getdbt.com/cloud/privacy-policy)[Create a GitHub issue](https://github.com/dbt-labs/docs.getdbt.com/issues)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.
