You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
avoids passing naming conventions as modules (#3229)
* adds /home/rudolfix/src/dlt to sys.path when running dlt commands and a cli flag to disable it
* adds cli docs check to lint
* avoids passing custom naming as modules in docs
* removes cli docs check due to Python 3.9
* fixes deploy cli
* adds pokemon table count consts
* improves custom naming convention docs
Copy file name to clipboardExpand all lines: docs/website/docs/general-usage/naming-convention.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,13 +134,16 @@ password="pass"
134
134
```
135
135
The snippet above demonstrates how to apply a certain naming for an example `zendesk` source.
136
136
137
-
You can use naming conventions that you created yourself or got from other users. In that case, you should pass a full Python import path to the [module that contains the naming convention](#write-your-own-naming-convention):
138
-
```toml
139
-
[schema]
140
-
naming="tests.common.cases.normalizers.sql_upper"
137
+
You can set the naming convention in your code via destination factory. This will overwrite destination's preferred convention and make it
`dlt`will import `tests.common.cases.normalizers.sql_upper` and use the `NamingConvention` class found in it as the naming convention.
143
145
146
+
You can use naming conventions that you created yourself or got from other users. In that case, you should pass a full Python import path to the [module that contains the naming convention](#write-your-own-naming-convention):
144
147
145
148
### Available naming conventions
146
149
You can pick from a few built-in naming conventions.
@@ -191,7 +194,32 @@ Custom naming conventions are classes that derive from `NamingConvention`, which
191
194
1. Each naming convention resides in a separate Python module (file).
192
195
2. The class is always named `NamingConvention`.
193
196
194
-
In that case, you can use a fully qualified module name in [schema configuration](#configure-naming-convention) or pass the module [explicitly](#configure-naming-convention).
197
+
In that case, you can use a fully qualified module name in [schema configuration](#configure-naming-convention) or pass the module fully qualified name [explicitly](#configure-naming-convention).
198
+
199
+
```toml
200
+
[schema]
201
+
naming="tests.common.cases.normalizers.sql_upper"
202
+
```
203
+
`dlt`will import `tests.common.cases.normalizers.sql_upper` and use the `NamingConvention` class found in it as the naming convention.
204
+
205
+
:::tip
206
+
Do not pass custom naming convention as modules if you do it explicitly. We recommend pattern below:
0 commit comments