исправлены ошибки в 15.function and 16.varuables_on_default

This commit is contained in:
Dmitry Medvedev
2026-10-21 21:29:00 +05:00
parent 71b3042b43
commit fb2df83786
2 changed files with 15 additions and 14 deletions
+6 -6
View File
@@ -21,7 +21,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 32,
"id": "ad2441e7", "id": "ad2441e7",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -156,7 +156,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 55,
"id": "d3c6683e", "id": "d3c6683e",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -172,11 +172,11 @@
], ],
"source": [ "source": [
"def build_mart_name(entity_name, layer):\n", "def build_mart_name(entity_name, layer):\n",
" print(f\"{layer}_{entity_name}\")\n", " return f\"{layer}_{entity_name}\"\n",
"\n", "\n",
"build_mart_name(\"orders\", \"dm\")\n", "print(build_mart_name(\"orders\", \"dm\"))\n",
"build_mart_name(\"users\", \"core\")\n", "print(build_mart_name(\"users\", \"core\"))\n",
"build_mart_name(\"payments\", \"stg\")" "print(build_mart_name(\"payments\", \"stg\"))"
] ]
} }
], ],
@@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 59,
"id": "2af8c0ea", "id": "2af8c0ea",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -30,9 +30,9 @@
], ],
"source": [ "source": [
"def log_job_start(job_name, level = \"INFO\", env = \"dev\"):\n", "def log_job_start(job_name, level = \"INFO\", env = \"dev\"):\n",
" print(f\"[{level}] {job_name} load_users started in {env}\")\n", " print(f\"[{level}] Job {job_name} started in {env}\")\n",
"\n", "\n",
"log_job_start(\"Job\")" "log_job_start(\"load_users\")"
] ]
}, },
{ {
@@ -138,7 +138,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 94,
"id": "ceb7c30b", "id": "ceb7c30b",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -148,7 +148,7 @@
"'Row is valid'" "'Row is valid'"
] ]
}, },
"execution_count": 55, "execution_count": 94,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@@ -158,10 +158,11 @@
" if required_fields is None:\n", " if required_fields is None:\n",
" required_fields = [\"id\"]\n", " required_fields = [\"id\"]\n",
" for field in required_fields:\n", " for field in required_fields:\n",
" if field not in required_fields:\n", " if field not in row:\n",
" return f\"Missing field: {field}\"\n", " return f\"Missing field: {field}\"\n",
" else:\n", " return \"Row is valid\"\n",
" return \"Row is valid\"" "\n",
"validate_row({\"id\": 1, \"email\":2}, [\"id\", \"email\"])"
] ]
} }
], ],