How to use execute_macro method in dbt-osmosis

Best Python code snippet using dbt-osmosis_python

impl.py

Source: impl.py Github

copy

Full Screen

...93 'relation': relation,94 'column_name': column_name,95 'new_column_type': new_column_type,96 }97 self.execute_macro(98 ALTER_COLUMN_TYPE_MACRO_NAME,99 kwargs=kwargs100 )101 def drop_relation(self, relation):102 if dbt.flags.USE_CACHE:103 self.cache.drop(relation)104 if relation.type is None:105 dbt.exceptions.raise_compiler_error(106 'Tried to drop relation {}, but its type is null.'107 .format(relation))108 self.execute_macro(109 DROP_RELATION_MACRO_NAME,110 kwargs={'relation': relation}111 )112 def truncate_relation(self, relation):113 self.execute_macro(114 TRUNCATE_RELATION_MACRO_NAME,115 kwargs={'relation': relation}116 )117 def rename_relation(self, from_relation, to_relation):118 if dbt.flags.USE_CACHE:119 self.cache.rename(from_relation, to_relation)120 kwargs = {'from_relation': from_relation, 'to_relation': to_relation}121 self.execute_macro(122 RENAME_RELATION_MACRO_NAME,123 kwargs=kwargs124 )125 def get_columns_in_relation(self, relation):126 return self.execute_macro(127 GET_COLUMNS_IN_RELATION_MACRO_NAME,128 kwargs={'relation': relation}129 )130 def create_schema(self, database, schema):131 logger.debug('Creating schema "%s"."%s".', database, schema)132 kwargs = {133 'database_name': self.quote_as_configured(database, 'database'),134 'schema_name': self.quote_as_configured(schema, 'schema'),135 }136 self.execute_macro(CREATE_SCHEMA_MACRO_NAME, kwargs=kwargs)137 self.commit_if_has_connection()138 def drop_schema(self, database, schema):139 logger.debug('Dropping schema "%s"."%s".', database, schema)140 kwargs = {141 'database_name': self.quote_as_configured(database, 'database'),142 'schema_name': self.quote_as_configured(schema, 'schema'),143 }144 self.execute_macro(DROP_SCHEMA_MACRO_NAME,145 kwargs=kwargs)146 def list_relations_without_caching(self, information_schema, schema):147 kwargs = {'information_schema': information_schema, 'schema': schema}148 results = self.execute_macro(149 LIST_RELATIONS_MACRO_NAME,150 kwargs=kwargs151 )152 relations = []153 quote_policy = {154 'database': True,155 'schema': True,156 'identifier': True157 }158 for _database, name, _schema, _type in results:159 relations.append(self.Relation.create(160 database=_database,161 schema=_schema,162 identifier=name,163 quote_policy=quote_policy,164 type=_type165 ))166 return relations167 def quote(cls, identifier):168 return '"{}"'.format(identifier)169 def list_schemas(self, database):170 results = self.execute_macro(171 LIST_SCHEMAS_MACRO_NAME,172 kwargs={'database': database}173 )174 return [row[0] for row in results]175 def check_schema_exists(self, database, schema):176 information_schema = self.Relation.create(177 database=database, schema=schema,178 quote_policy=self.config.quoting179 ).information_schema()180 kwargs = {'information_schema': information_schema, 'schema': schema}181 results = self.execute_macro(182 CHECK_SCHEMA_EXISTS_MACRO_NAME,183 kwargs=kwargs184 )...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

An Interactive Guide To CSS Hover Effects

Building a website is all about keeping the user experience in mind. Ultimately, it’s about providing visitors with a mind-blowing experience so they’ll keep coming back. One way to ensure visitors have a great time on your site is to add some eye-catching text or image animations.

Testing in Production: A Detailed Guide

When most firms employed a waterfall development model, it was widely joked about in the industry that Google kept its products in beta forever. Google has been a pioneer in making the case for in-production testing. Traditionally, before a build could go live, a tester was responsible for testing all scenarios, both defined and extempore, in a testing environment. However, this concept is evolving on multiple fronts today. For example, the tester is no longer testing alone. Developers, designers, build engineers, other stakeholders, and end users, both inside and outside the product team, are testing the product and providing feedback.

Developers and Bugs – why are they happening again and again?

Entering the world of testers, one question started to formulate in my mind: “what is the reason that bugs happen?”.

A Complete Guide To CSS Container Queries

In 2007, Steve Jobs launched the first iPhone, which revolutionized the world. But because of that, many businesses dealt with the problem of changing the layout of websites from desktop to mobile by delivering completely different mobile-compatible websites under the subdomain of ‘m’ (e.g., https://m.facebook.com). And we were all trying to figure out how to work in this new world of contending with mobile and desktop screen sizes.

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run dbt-osmosis automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful