How to use get_osmosis_config method in dbt-osmosis

Best Python code snippet using dbt-osmosis_python

osmosis.py

Source: osmosis.py Github

copy

Full Screen

...700 subset.items() if subset else chain(self.dbt.nodes.items(), self.dbt.sources.items())701 ):702 if self._filter_model(dbt_node):703 yield unique_id, dbt_node704 def get_osmosis_config(self, node: ManifestNode) -> Optional[SchemaFileOrganizationPattern]:705 """Validates a config string. If input is a source, we return the resource type str instead"""706 if node.resource_type == NodeType.Source:707 return None708 osmosis_config = node.config.get("dbt-osmosis")709 if not osmosis_config:710 raise MissingOsmosisConfig(711 f"Config not set for model {node.name}, we recommend setting the config at a directory level through the `dbt_project.yml`"712 )713 try:714 return SchemaFileOrganizationPattern(osmosis_config)715 except ValueError as exc:716 raise InvalidOsmosisConfig(717 f"Invalid config for model {node.name}: {osmosis_config}"718 ) from exc719 def get_schema_path(self, node: ManifestNode) -> Optional[Path]:720 """Resolve absolute schema file path for a manifest node"""721 schema_path = None722 if node.resource_type == NodeType.Model and node.patch_path:723 schema_path: str = node.patch_path.partition(":/​/​")[-1]724 elif node.resource_type == NodeType.Source:725 if hasattr(node, "source_name"):726 schema_path: str = node.path727 if schema_path:728 return Path(self.project_root).joinpath(schema_path)729 def get_target_schema_path(self, node: ManifestNode) -> Path:730 """Resolve the correct schema yml target based on the dbt-osmosis config for the model /​ directory"""731 osmosis_config = self.get_osmosis_config(node)732 if not osmosis_config:733 return Path(node.root_path, node.original_file_path)734 # Here we resolve file migration targets based on the config735 if osmosis_config == SchemaFileOrganizationPattern.SchemaYaml:736 schema = "schema"737 elif osmosis_config == SchemaFileOrganizationPattern.FolderYaml:738 schema = node.fqn[-2]739 elif osmosis_config == SchemaFileOrganizationPattern.ModelYaml:740 schema = node.name741 elif osmosis_config == SchemaFileOrganizationPattern.SchemaModelYaml:742 schema = "schema/​" + node.name743 elif osmosis_config == SchemaFileOrganizationPattern.UnderscoreModelYaml:744 schema = "_" + node.name745 else:...

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