Skip to content

Instantly share code, notes, and snippets.

from distutils.debug import DEBUG
from pickle import TRUE
import json
import os
import collections
from collections import defaultdict
DEBUG = TRUE
dict_1 = {'John': 15, 'Rick': {10,15}, 'Misa': 12}
from dagster import job, op, get_dagster_logger
import json
from pickle import TRUE
from dagster_celery import celery_executor
import os
import collections
from collections import defaultdict
# manifest.json catalog.json
@op
from dagster import job, op, get_dagster_logger
import json
from pickle import TRUE
from dagster_celery import celery_executor
import os
import collections
from collections import defaultdict
# manifest.json catalog.json
@op
from distutils.debug import DEBUG
from pickle import TRUE
import requests
import json
import os
import collections
from collections import defaultdict
DEBUG = TRUE
import requests
from dagster import job, op, get_dagster_logger
import json
from dagster_celery import celery_executor
import os
@op
# def docs_merge_op(context):
def docs_merge_op():
import pathlib
{{ config(
materialized='incremental'
, as_columnstore=false
, pre_hook="""
{% if is_incremental() %}
delete from {{this}}
where Период >= {{ CurrentDay() }}
{% endif %}
"""
{"logs": [{"code": "A001", "data": {"v": "=1.0.0"}, "invocation_id": "2ce3fa58-066a-4907-8580-c3efe5814663", "level": "info", "log_version": 1, "msg": "Running with dbt=1.0.0", "node_info": {}, "pid": 452, "thread_name": "MainThread", "ts": "2022-03-31T09:31:48.578486Z", "type": "log_line"}, {"code": "W006", "data": {"stat_line": "5 models, 0 tests, 0 snapshots, 0 analyses, 169 macros, 0 operations, 0 seed files, 5 sources, 0 exposures, 0 metrics"}, "invocation_id": "2ce3fa58-066a-4907-8580-c3efe5814663", "level": "info", "log_version": 1, "msg": "Found 5 models, 0 tests, 0 snapshots, 0 analyses, 169 macros, 0 operations, 0 seed files, 5 sources, 0 exposures, 0 metrics", "node_info": {}, "pid": 452, "thread_name": "MainThread", "ts": "2022-03-31T09:31:48.780776Z", "type": "log_line"}, {"code": "Q026", "data": {"num_threads": 20, "target_name": "prod"}, "invocation_id": "2ce3fa58-066a-4907-8580-c3efe5814663", "level": "info", "log_version": 1, "msg": "Concurrency: 20 threads (target='prod')", "node_info": {},
select
{{ BinaryToVarhar( "Ссылка" ) }} as "Ссылка",
{{ BinaryToVarhar( "ПометкаУдаления" ) }} as "ПометкаУдаления",
{{ BinaryToVarhar( "Родитель" ) }} as "Родитель",
{{ BinaryToVarhar( "ЭтоГруппа" ) }} as "ЭтоГруппа",
"Код" ,
"Наименование" ,
"IDWeb" ,
{{ BinaryToVarhar( "VIP_Ремонт" ) }} as "VIP_Ремонт" ,
with client as
(
select p."ссылка" as "ссылка"
,p."код" as "код"
,p."наименование" as "клиент",
{{ client_fields( 'select distinct p."наименование" from ml."dm_покупатели" p',
'клиент',"клиент_" ,'str') }}
,if(p."пол"='М', 'М', '') as "полмужской"
,if(p."пол"='Ж', 'Ж', '') as "полженский"
with client as
(
select p."ссылка" as "ссылка"
,p."код" as "код"
,p."наименование" as "клиент"
,if(p."пол"='М', 'М', '') as "полмужской"
,if(p."пол"='Ж', 'Ж', '') as "полженский"
,dimM."наименование" as "размеробувим_группа" ,
{{ client_fields( 'select distinct dimM."наименование" from ml."dm_покупатели" p