<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Łukasz Ściga on Medium]]></title>
        <description><![CDATA[Stories by Łukasz Ściga on Medium]]></description>
        <link>https://medium.com/@lukasz-sciga?source=rss-5e2fd2155f5b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fqYqg3VxiYiVD03HbLkzqA.png</url>
            <title>Stories by Łukasz Ściga on Medium</title>
            <link>https://medium.com/@lukasz-sciga?source=rss-5e2fd2155f5b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:32:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukasz-sciga/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Code Reviewer: Enhancing Code Review Efficiency with ChatGPT]]></title>
            <link>https://medium.astrafy.io/ai-code-reviewer-enhancing-code-review-efficiency-with-chatgpt-bc68e42a5889?source=rss-5e2fd2155f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc68e42a5889</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Łukasz Ściga]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 13:52:36 GMT</pubDate>
            <atom:updated>2023-07-26T13:52:36.500Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*QdJpNnNUWd0om0ZdvrW3-w.png" /><figcaption>Midjourney: In a gleaming, high-tech factory of tomorrow, envision AI quality assurance at its finest. Show us a hyper-advanced robotic arm meticulously inspecting and sorting products on a conveyer belt with unparalleled precision and speed. The vibrant neon lights accentuate the futuristic aura of the scene. Futuristic style</figcaption></figure><p>Code review is a crucial part of the software development process. It helps maintain code quality, find potential bugs, and ensures adherence to coding standards. However, code review can be time-consuming, especially for senior developers who are often required to provide general-purpose comments on various aspects of the code. Code reviews like most things in this world, can be seen as a tradeoff. On one hand, the aim is to decrease the chance of bugs being smuggled into the codebase, making sure the code adheres to standards and also have the other pair of eyes look at the code created, to make sure it’s not missing the mark. On the other hand, code reviews are time-consuming, can stall development if not done efficiently, and are often costly for organizations (it is usually the senior developers that give more precious code review comments, and the more they spend on reviewing the less time they spent elsewhere). There is a clear incentive for all the parties involved to increase the efficiency of Code Reviews and decrease the negative impact they have on the IT organization.</p><p>To alleviate this burden and make the code review process more efficient, we propose AI Code Reviewer.</p><h3>The Reality of Code Reviews</h3><p>Code Reviews serve multiple purposes. In the industry, we like to say that it increases the security of the code merged, but there is no real measure to prove that. However, code reviews are full of suggestions regarding code style and structure. Things like “extract this to a variable/method”, “change this name to be more descriptive”, or “log a message here”. Let’s say, that 80% of the comments are about things that are common, easy to spot, and regarding general knowledge, and 20% are real to-the-point comments, questioning logic and possible runtime issues. Then, if we can tackle the first group, we can substantially cut the needed time to review a given piece of code.</p><p>Enter <strong>AI Code Reviewer</strong>.</p><h3>How the AI Code Reviewer Works</h3><p>Since Large Language Models were trained on swaths of code and internet pages, we can leverage them to apply the general “how to code” knowledge during Code Review. Then, we allow ourselves to focus on the logic and runtime considerations, knowing AI had already dealt with “the usual”.</p><p>The idea is straightforward. Take the file changes from the Merge Request, send them to <strong>OpenAI API</strong>, with proper prompts, and receive the review comments. Since, at <a href="https://www.astrafy.io/en/">Astrafy</a>, we use Gitlab, we wrapped the script in Gitlab CI and it is triggered during Merge Request events, such as opening one, or updating one with additional commits.</p><h3>ChatGPT Considerations</h3><p>We can use different roles when dealing with OpenAI API. We use system prompt to explain how we want ChatGPT to behave. There we say all about its role as the code reviewer, in which format we will send the diff, and what are we expecting as its output. Then as the user prompt, we send the actual diffs marked with file paths. We also decided to use GPT 3.5 in order not to drain GPT 4 messages too fast.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1abed4a875d061747a22a7c2057b20f5/href">https://medium.com/media/1abed4a875d061747a22a7c2057b20f5/href</a></iframe><h3>Lessons learned</h3><ol><li>We found that satisfying AI Code Reviewer is <strong>impossible</strong>. It will generate remarks as long as there are any changes. Learn to sift through its remarks to find the valuable ones, instead of blindly following them.</li><li>It makes it easier to separate the code review into two parts. In the first part, you can use the <strong>AI Code Reviewer</strong> in order to find out where you can improve on the syntax and structure. After that, in the second part, ask <strong>a human</strong> to review the code, disregarding the comments from AI. This way you’re not caught in back and forth with AI and colleagues to add all the changes.</li><li>Remember that using this tool equals sending your code diffs to OpenAI, which is not everywhere encouraged if not outright forbidden. Make sure you can use it, before employing it full scale in your organization.</li><li><strong>Large diffs</strong> are problematic. ChatGPT has a token limit, which makes it impossible to send arbitrarily large code review changes. You can modify the code to split it into multiple requests, however, when done so, you will receive multiple separate reviews, instead of one. In large code reviews, context is everything. The ability to follow the changes from one place to another is crucial. If you automatically split the diffs based on arbitrary numbers, you run into the risk of having incoherent reviews.</li><li>Super small reviews are also problematic. ChatGPT will attempt to generate, for example, 8 distinct comments based on your <strong>3 lines</strong> changed. You might want to introduce the lower limit of lines changed that qualifies for AI Review.</li></ol><h3>AI Review Code</h3><p>The code is simple and extensible. It boils down to three steps:</p><ol><li>Prepare a message with lines changed, that ChatGPT should review</li><li>Send the message as well as instructions what to do with it as prompts</li><li>Add the response as the review comment.</li></ol><p>For full example see a public repository with this hooked up on every Merge Request <a href="https://bit.ly/3DvP0Ul">here</a>. Below is the python script with majority of the logic.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ffa84c53ff7b63c831846804933aa10/href">https://medium.com/media/6ffa84c53ff7b63c831846804933aa10/href</a></iframe><h3>Conclusion</h3><p>AI Reviews will slowly become a thing in the industry. Anything that improves efficiency and cut costs will. It’s worth noting that it will not replace human code reviewers but instead supercharge code reviews with AI guidance. While code reviews are sometimes bypassed or inefficiently reviewed, AI code reviewer will solve that by guiding, preparing and pointing out potential wrong practices in the code. In the end, it just adds one fully automated step in a merge request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4YKZs0K30Fk775NS" /><figcaption>Merge Review process</figcaption></figure><p>If you are looking for some support on projects related to <strong>GenAI</strong>, feel free to reach out to us at sales@astrafy.io.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*A-NUwZnIJjs4szqOh33nuA.png" /><figcaption>Midjourney: Dystopian. Paint a dystopian vision of a world where AI dominates quality assurance. Create a dark, moody image of an automated factory devoid of human presence. Cold, unfeeling robotic arms scrutinize everyday items with an eerie precision.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc68e42a5889" width="1" height="1" alt=""><hr><p><a href="https://medium.astrafy.io/ai-code-reviewer-enhancing-code-review-efficiency-with-chatgpt-bc68e42a5889">AI Code Reviewer: Enhancing Code Review Efficiency with ChatGPT</a> was originally published in <a href="https://medium.astrafy.io/">Astrafy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the Data Contracts with dbt, Google Cloud & Great Expectations: Part 3]]></title>
            <link>https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df?source=rss-5e2fd2155f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c2675d549df</guid>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-contract]]></category>
            <dc:creator><![CDATA[Łukasz Ściga]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 14:44:39 GMT</pubDate>
            <atom:updated>2023-07-18T14:44:39.159Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Data Contracts Execution Layer</em></p><h3>Introduction</h3><p>In the realm of data processing, ensuring the integrity and quality of data is of paramount importance. One way to address this is through the implementation of data contracts, which serve as a means to verify and validate the data before it undergoes transformations. This article delves deeper into the concept of data contracts and explores their role in guaranteeing data quality. Specifically, it focuses on schema validation as a crucial aspect of data contracts, highlighting how it ensures the presence of required fields in the data table without restricting the addition of supplementary columns. The article also sheds light on the technical implementation of data contract checks within the context of a standard data processing stack comprising dbt on BigQuery scheduled by the Airflow instance. Additionally, it discusses the utilization of Great Expectations, an extensible tool, for wrapping the schema validation process, along with the incorporation of Docker containers and Kubernetes Pod Operator in the execution workflow.</p><p>This article is the third part of the series. See <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-1-939774fc7284">Part 1</a> for a high-level overview of Data Contracts subsystems and a gentle introduction to all of the technologies that we’re using in the implementation. Take a look at <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-2-112c96c2914a">Part 2</a> for the implementation of the Data Contract repository and how Data Contracts are versioned and stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IqhoHkeofkmgxtOW" /></figure><h3>Schema validation</h3><p>Schema validation is highly dependent on the schema language chosen. If your implementation uses Avro, you should consider using libraries like Python’s <em>fastavro</em> in order not to reinvent the wheel. We chose our custom but simple schema representation, therefore we needed to provide our own way of validating the schema.</p><p>Remember, that the goal here is to check whether all the contracted fields are present in an actual table that we’re referring to, not to make sure that both schemas are identical. This way Data Producers can freely expand on their tables without the burden of changing data contracts every time they do so.</p><p>Our schema representation uses the same concepts as the BigQuery schema. This means that it allows for repeated fields (arrays) but repeated fields cannot be repeated again directly (arrays of arrays). In order to accomplish this you need to create an array of structs that have an array as a parameter. With that being said here’s a code that does the validation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3240402d828a0a0c3bb793a33ec93b02/href">https://medium.com/media/3240402d828a0a0c3bb793a33ec93b02/href</a></iframe><p>Accepting expected_fields as a dictionary of keys and values taken directly with the help of <em>Pyaml</em> parsing the schema and actual_schema taken from <em>google-cloud-bigquery</em> Python library, you can validate, whether all fields present in the contract are also present at the table. This code returns a bool containing the overall result and a list of string messages containing errors if validation wasn’t successful.</p><p>Before you can actually validate the schema you will need to retrieve contracts from Google Storage, map the contracts to tables, and get schemas from the tables in BigQuery.</p><h3>Retrieving data contracts</h3><p>Here, we’re getting the latest version of the contracts. For more mature implementation, you will want to have the ability to specify the version directly (and pass it as an argument through Airflow) in case of a faulty contract is released.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9895418a9422061dda971056b4c97105/href">https://medium.com/media/9895418a9422061dda971056b4c97105/href</a></iframe><p>You can also see we do some direct string manipulation on the path with no error checking. Since the paths are being created with a tested and automated procedure we have reduced the risk of creating wrong paths, but you might want to opt in for more precautionary measures.</p><h3>Mapping data product to actual tables</h3><p>In our case, data contracts are being run per data product. Each data product may contain multiple tables, but only some of them are contracted. This means that we need to have a way to communicate which of the tables should be checked. There are two general approaches that you can choose from.</p><p>The first approach is to assume that it’s the data contract’s job to define all parameters, including the data product it belongs to, what is the fully qualified table id of the table it is referring to, etc. This approach will scale well, as your data contract capabilities will grow, however, it complicates the contract itself — not only does it need to have the schema but now additional parameters that are defining what should happen with it.</p><p>The second approach would be to define logic somewhere else — it can be governed centrally, or by data producer teams in a distributed fashion, but it would lay outside of data contracts themselves. We chose this approach because it made contracts easier, which we believe is key to fostering their adoption.</p><p>This required us to create some sort of mapping, between the tables that are contracted and their respective data products. We chose a simple BigQuery table to store this information. We can update this table automatically based on the convention or manually for starters.</p><p>As far as conventions go, in dbt 1.5 scopes of models are being introduced. You can make a model public. This can be picked up by the CI pipeline (either parsing your dbt files, or <em>manifest.json</em> artifact) which will update this information in the table when deploying the code to an environment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7985ea3d7a40bebb02a64c4696ead4aa/href">https://medium.com/media/7985ea3d7a40bebb02a64c4696ead4aa/href</a></iframe><h3>Custom Great Expectation</h3><p>As mentioned, we have already used Great Expectations and we believe it’s a great tool for data stack at every company. Great Expectations allow us to define the tests on the data itself. In this article series, we focus on schema validation, and since we are using our custom schema, we need to wrap our validation in a Custom Expectation. For this, we create Expectation Suite dynamically and add it to other suites. For more information about Great Expectations and Data Contracts see our <a href="https://www.astrafy.io/articles/data-quality-with-great-expectations">previous post</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed3ac831327901066c989d08876a450b/href">https://medium.com/media/ed3ac831327901066c989d08876a450b/href</a></iframe><p>Great Expectations allow you to define Expectation Suites both statically as files and dynamically as part of the Python code. We add several custom arguments, such as ‘critical’ to tell us whether the failure of this check should cause failure of the whole validation task in Airflow. (And since we really care about data contracts, we set it to ‘True’).</p><p>We create one suite for each table we found a mapping for. This is also a design decision that you can consider changing. For example, you might want to create data contract suites for every contract found in the bucket or have another place where you store which of the tables should have their schema validated.</p><h3>Alerting</h3><p>If any of the ‘critical’ suites fail, Airflow task would also turn red and a message to the Slack channel will be posted. If you use an on-call tool, such as Pager Duty it makes sense to integrate it as well. Depending on the preference you might want to send the alert from the Python layer that has run the expectations or from the Airflow layer as a SLA miss callback.</p><p>The key takeaway is that Producers are the group that should be interested in receiving those alerts. However, it might happen that introducing such contracts will be seen as an unnecessary hurdle and Producers might be unwilling to receive such alerts. In such cases, we recommend starting with notifying the Consumers through the alerting, and then Consumers may reach out to Producers. This, although not ideal, is often a compromise that allows for the introduction of data contracts into the company. In the future, after proven successful, contracts may be deemed valuable enough to limit the freedom of Producers with the pesky alerts.</p><h3>Conclusion</h3><p>In conclusion, data contracts, and schema validation are essential for maintaining data integrity and quality in the realm of data processing. By using data contracts, we can verify and validate data before transformations, ensuring the presence of required fields while allowing for flexibility in adding supplementary columns. Technical implementation involves mapping contracts to tables, utilizing tools like Great Expectations for schema validation, and setting up alerting mechanisms to promptly address any validation failures. Incorporating data contracts into the data processing workflow fosters trust in the data and enables organizations to make more informed decisions based on reliable and consistent data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c2675d549df" width="1" height="1" alt=""><hr><p><a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df">Implementation of the Data Contracts with dbt, Google Cloud &amp; Great Expectations: Part 3</a> was originally published in <a href="https://medium.astrafy.io/">Astrafy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the Data Contracts with dbt, Google Cloud & Great Expectations: Part 2]]></title>
            <link>https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-2-112c96c2914a?source=rss-5e2fd2155f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/112c96c2914a</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[data-contract]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Łukasz Ściga]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 14:44:12 GMT</pubDate>
            <atom:updated>2023-07-18T14:44:12.921Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Data Contracts Management Layer</em></p><h3>Introduction</h3><p>In this article, we delve into the heart of the data contract system — its collaborative layer which involves Data Producers and Data Consumers. This layer, anchored by the Data Contract Store, maintains and versions data contracts. For our implementation at <a href="https://www.astrafy.io/en/">Astrafy</a>, we’ve combined a git repository with a Cloud Storage bucket. This system allows data contracts — essentially text files with schema descriptions — to be read, written, and comprehended by users. Producers propose changes to these contracts, and Consumers review and approve them, facilitating a shared understanding of the changes. Upon approval, changes are deployed to Cloud Storage through an automated CI pipeline. Our system also ensures a high level of security and traceability, with version control, retention policies, and IAM role management. Let’s dive deeper into how this sophisticated system operates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lesYGJHH2l5h29a5" /></figure><p>Refer to <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-1-939774fc7284">Part 1</a> for the high-level architecture of this implementation, and to <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df">Part 3</a> for more details on the data contracts execution layer.</p><h3>Schema language selection</h3><p>The goal of this subsystem is to allow data producers and consumers to establish an agreement regarding the data processed. Depending on the experience of analytics engineers in your organization you can modify the implementation so that it will suit your needs. In our case, we usually work with people dealing with schema files daily and with git capabilities therefore we structured our solution around those tools. You can imagine that in other organizations where this wouldn’t be the case, Data Contract Management Layer would involve web apps with drag-and-drop interfaces to build contracts. Such tools are often easier to use for data analysts that do not have technical expertise however they usually take more time to develop and are more difficult to expand.</p><p>The contract that we deal with here, is a schema file that is capable of describing a set of columns including their names and types. On top of that fields can be lists/arrays or represent a struct. There is a couple of schema languages that can be used for this task and on top of them you can build your schema language. Let’s review our options:</p><ul><li>Open source performant message passing languages: <strong>Apache Avro</strong>, <strong>Protobuf</strong></li><li>dbt schema files</li><li>BigQuery JSON schema</li><li>Custom schema</li></ul><h3>Apache Avro &amp; Protobuf</h3><p>These are the languages capable of expressing schemas, both names and types. They are used to generate classes in various programming languages. They are capable of expressing arrays and structs. On top of that, these languages can automatically guard you against breaking backward compatibility in your schemas (for example removing a column). Also, if you happen to work with Apache Kafka or Apache Hadoop chances are that you’re already using AVRO and can leverage that for your implementation of Data Contracts.</p><p>However, for the case of dbt &amp; BigQuery users, these languages might not be the best fit. Firstly, they do not provide common types in the analytics world such as various DateTime types and Numerics. One can express such types as a string, but then the contract loses its value: you cannot enforce the existence of the field “buy_timestamp” of type Timestamp, you can only do that with type String, and we all know how common these kinds of type errors are in the analytics world. Secondly, they use concepts and tools that are familiar to people from the Software Engineering world but not necessarily from Data Analytics, and it might make it more difficult to work with. Protobuf requires attaching numbers to each field, Avro ecosystem uses JVM which is less common in analytics.</p><h3>dbt Schema Files</h3><p>Maybe, there is no need to reinvent the wheel. dbt models can have schema files attached to them, maybe it will be enough to use them here?</p><p>Data Contracts should be usable across your whole data organization. Most likely, only a fraction of your data tools use dbt. Hopefully, it’s most of the processing at least, but it’s common that due to legacy systems, migrations, or just sheer force of will, the systems producing the data or consuming the data are not running inside dbt. Therefore, Data Contract to be used across the organization cannot be dbt-specific. Ideally, you would be able to use the same Data Contract between table in BigQuery and the Data Studio dashboard.</p><p>On top of that, dbt schema files define a lot more than just the schema. It is difficult to look at such a file and from a glance determine what kind of columns it needs. Also, we don’t need nor want to contract all of the columns from a table.</p><h3>BigQuery JSON schema</h3><p>While choosing this representation would make schema comparison much easier it is not without its flaws either. JSON as a format, is (even though a big step up from XML) quite wordy, you need to make sure your quotes are in place. Also choosing BigQuery JSON schema and comparing schemas 1:1 would make it easy to just copy and paste an existing table with all of its columns as contracted, which is not necessarily the thing we want.</p><p>There are no hard arguments against BigQuery JSON schema. Accepting Google Cloud as a data analytics environment you are quite locked into BigQuery anyway, and even though it may not gonna cover all of the use cases, probably the vast majority of them would store its data on BQ. Having said that, BigQuery JSON schema was the runner-up. It lost to the Custom Schema</p><h3>Custom Schema for Data Contracts</h3><p>Since most of our customers are using dbt running on BigQuery they are used to working with YAML files expressing schema. Having an easy schema language, supporting all of the high-level BigQuery types seems like the best of the worlds I described above. By keeping schema files simple, and providing examples, analytics engineers can quickly grasp the concepts and how to contract complicated fields in this schema. Below is the file with all possible types:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48868c445eaf0ff1c3f87e10af0a9eb1/href">https://medium.com/media/48868c445eaf0ff1c3f87e10af0a9eb1/href</a></iframe><h3>Data Contracts Repository Structure</h3><p>There needs to be a separate directory for each data product to allow an easy way of retrieving all contracts for a given data product. Also, each schema file should be mapped to a given entity. We might’ve opted for making just one YAML file with the name of the entity, however, to keep this structure easy to extend in the future (for example with data tests defined here) we opted to have a separate directory for each entity and only there a schema file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*_MAtVwOjxUW9sKp3" /><figcaption>Directory &amp; file structure of data contracts repo</figcaption></figure><h3>Deployment pipelines</h3><p>The aim of the deployment pipelines is… well to deploy the contracts to Cloud Storage, from where it will be accessible to other principals. The added feature of using Git repositories is the ease of versioning thanks to tags that can be applied to commits. We leverage it in our implementation.</p><p>Astrafy operates on Gitlab and uses Gitlab CI which is similar to GitHub Actions with its capabilities. In our deployment pipeline, we distinguish two separate environments: development &amp; production. The code is being versioned with the help of the git tags.</p><p>The production deployment pipeline has two major steps:</p><ol><li>Bump the patch part of version</li><li>Deploy files to the prod bucket</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qJV84VdiIL18vbWHtSyiw.png" /><figcaption>Gitlab CI pipeline successfully ended</figcaption></figure><p>For the first part, it reads the latest tag from the git history, increases the patch version by one, tags the current commit, and pushes it to the repository. (Make sure that the CI token has write access to the repository!)</p><p>For the second part, it authenticates with the given Service Account on Google Cloud and uses gsutil rsync, to create a new directory within the production bucket. The bucket, Service Account, and permissions need to be in place before the deployment happens. For setting up infrastructure on Google Cloud we use Terraform.</p><p>The production pipeline is triggered when there are new commits pushed on the main branch. This means that if you enforce Pull Requests for the updates of your main branch, any changes to the contract must be done through the review.</p><p>The development deployment pipeline is simpler, it only deploys contracts to the dev bucket for the current version (taken from the latest git tag). You can trigger it manually, or you can have it triggered based on the push to the non-main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4PMr1If43XC9P9yl" /><figcaption>Data Contracts Structure on Cloud Storage bucket</figcaption></figure><h3>Conclusion</h3><p>The collaborative layer of the data contract system presents an approach to managing and versioning data contracts. By using a blend of git repository and Cloud Storage bucket, the system provides a platform that’s easy to use, secure, and fosters collaboration between Data Producers and Data Consumers. The mechanisms in place allow for a streamlined review and approval process, ensuring that any changes to the data contracts are mutually agreed upon, promoting a shared understanding and maintaining the integrity of the data.</p><p>The system also provides a CI pipeline that deploys approved changes efficiently, facilitating easy version control and the ability to revert to previous versions of the contract if needed. Moreover, the incorporation of retention policies and IAM roles management adds an extra layer of security, safeguarding the data and preventing unauthorized modifications.</p><p>This collaborative layer is an integral part of the broader data contract system. For a more comprehensive understanding, remember to review <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-1-939774fc7284">Part 1</a> for the high-level architecture of this implementation, and see <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df">Part 3</a>, where we dissect the Data Contract Execution Layer in more depth. This series aims to provide a thorough insight into the power and sophistication of the data contract system, highlighting how it can revolutionize your data management strategies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112c96c2914a" width="1" height="1" alt=""><hr><p><a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-2-112c96c2914a">Implementation of the Data Contracts with dbt, Google Cloud &amp; Great Expectations: Part 2</a> was originally published in <a href="https://medium.astrafy.io/">Astrafy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the Data Contracts with dbt, Google Cloud & Great Expectations: Part 1]]></title>
            <link>https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-1-939774fc7284?source=rss-5e2fd2155f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/939774fc7284</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[data-contract]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Łukasz Ściga]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 14:43:45 GMT</pubDate>
            <atom:updated>2023-07-18T14:43:45.800Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“Data contracts are like bridges, connecting disparate islands of information; their strength lies not in their existence, but in their precision, clarity, and mutual understanding.”</em></p><h3>Introduction</h3><p>In our contemporary, data-driven business environment, the discipline of data management is continually evolving, and organizations are actively seeking ways to improve the integrity, availability, and reliability of their data. In this context, the ‘data contracts’ concept emerges as a powerful tool. Data Contract is an agreement between Data Producer and Data Consumer regarding the data provided. It can refer to various features of the data like schema, values contained in the data, or the timeliness of it. This series explores how data contracts can be implemented using Data Build Tool (dbt), Google Cloud, and Great Expectations.</p><p>This series is split into three parts:</p><ul><li><strong>Part 1</strong> provides a high-level overview of Data Contracts subsystems and a gentle introduction to all of the technologies that will be used throughout this series.</li><li><a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-2-112c96c2914a"><strong>Part 2</strong></a> focuses on the implementation of the Data Contract repository and how Data Producers and Consumers collaborate to make sure the data is of the highest quality.</li><li><a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df"><strong>Part 3</strong></a><strong> </strong>features an in-depth look at executing Data Contract checks in runtime and explores their outcomes.</li></ul><p>Data Contracts stand on top of various technology stacks and architectures developed in the last years. This means that talking about Data Contracts inevitably brings in a lot of new concepts and frameworks. In the later part of the article, you can find the Glossary of the terms used with links for further exploration of the concepts.</p><p>This series will focus on Data Contracts that are external to any one system and can be extended with additional functionality depending on the needs of your organization. It is another iteration of the data contract system, therefore a lot of the infrastructure components you may find familiar if you have already read our <a href="https://www.astrafy.io/articles/data-quality-with-great-expectations">previous article about Data Contracts</a>. It describes in detail some of the aspects that will be covered here only briefly so make sure to take a look!</p><h3>High-Level Architecture of the Data Contract System</h3><p>Data Contracts are being fleshed out in the industry and there are different approaches to building a system using Data Contracts. No matter the details though, from a high-level viewpoint, any system capable of performing Data Contracts work will need two parts:</p><ul><li>Data Contracts Management Layer</li><li>Data Contracts Execution Layer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JEVamhJiRpiBzoC8" /><figcaption>Layers’ Boundaries</figcaption></figure><h3>Data Contracts Management Layer</h3><p>This part of the system allows Data Producers and Data Consumers to collaborate in creating and maintaining the data contracts. The key part of this layer is Data Contract Store. This is the place where Data Contracts will be kept and versioned to allow for lookup when needed. On top of the storage, Data Producers need the ability to propose changes to data contracts and Data Consumers need the ability to comment and accept the changes. For Astrafy implementation we’ve chosen a combination of git repository and a Cloud Storage bucket. As a Google Cloud partner we are always favouring Google Cloud products.</p><p>Contracts are after all text files, that need to be read, written, and understood by humans. They usually contain some sort of schema that describes the columns. When Data Producers want to introduce the change to the contract, they edit the file, commit the changes and push it to the git repository. They then open PR and request a review from Data Consumers. This ensures that Consumers acknowledge the change. They can also interfere by adding comments and learn more about the change from Producers. The git repository does not allow merging of the PRs without the explicit approval of Data Consumers. This enforcement is one of the purposes of a “contract” where one party cannot change unilaterally the definition of the contract.</p><p>After the merge happens CI pipeline is triggered which bumps the latest git tag and then deploys a new set of contracts under a new version to the Cloud Storage bucket. There, each version is a separate directory, so that you can always roll back to the earlier versions of the contract. On top of that, you can leverage the retention policies and permanently lock the bucket with the contracts so that no bad actor can modify the files directly, although for most cases simple IAM roles management should be enough to keep only the dedicated personas available to modify the bucket contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0Xc_48lscMj16y1i" /><figcaption>Management Layer: Collaboration via Git, tooling on Google Cloud</figcaption></figure><p>Note that this implementation has all data contracts in a single repository. This has the advantages of being easy to set up, and when introducing structural changes to contracts (like adding new meta attributes) it is more simple to upgrade all of it in one place. However, when dealing with large data organizations, having all of the contracts in one place can also slow down the changes, when multiple parties need to commit to the repo frequently. For such cases you can consider having one contract repository per data product.</p><h3>Data Contracts Execution Layer</h3><p>This part deals with running the checks that are engraved in the data contract. Usually, data is processed in a batch mode, on a schedule, most commonly every day. This means that every day new chunk of data with values regarding the last day is being processed and appended to the table. Data producers, sometimes unknowingly can introduce changes from day to day. This might cause failure downstream when Data Consumers are trying to read the data. Therefore the data contract aims to run the checks and if any of them fail, abort the scheduled transformations (they would fail or produce bad-quality data anyway) and alert producers.</p><p>This step should happen immediately before the data transformation. For this implementation, we used a standard data processing stack, which is dbt on BigQuery scheduled by the Airflow instance. Therefore execution of data contract checks needs to happen as a separate task in Airflow’s DAG. This gives us the benefit of an easy transformation skip, when the data contract stage fails — by default, Airflow will not execute a downstream task if any of the upstream ones have failed.</p><p>Data Contracts can encode a variety of information and checks that can be done against a given table, as depicted in following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5_DmBd4Z12KXLrHt" /><figcaption>Data Contract is an agreement between Data Producers &amp; Data Consumers</figcaption></figure><p>In this implementation, we will focus on schema validation. We want to make sure that fields that are in the contract schema, are present in the actual table schema that we will attempt to read. We will check both the name and the type of the fields, to make sure the schema is valid. Note that, our goal here is to make sure that the fields that are needed for the Consumers are present, not that table has no other columns than the contracted ones. This way, Consumers can rely on the data safely thanks to the contract, but also Producers are free to extend table functionality and add more fields, without modifying the contract every time.</p><p>Let’s emphasize this point here. Both Consumers and Producers are the groups that are in the organization and we care about the wellbeing of both of them. Data contracts are a mean to help with data quality, but they cannot be too much of a burden for the Producers so they will seek alternative solutions to producing the data. The spirit of collaboration between Producers and Consumers is crucial for any Data Contract System to work.</p><p>Since our Airflow has separate DAGs for each Data Product, data contracts will also be run “per data product”. This means that our execution logic needs to know what contracts should be run for a given data product and also, for any given contract what is the fully qualified table id. Our implementation solves the first issue by keeping the contracts in a directory with the name of the data product. For the second point, we maintain a mapping table between the name of the table in the data contracts repository and the table id in BigQuery. More information about this implementation as well as the alternatives can be found in part three.</p><p>The schema validation step could be just Python code, but we opted for wrapping it in Great Expectations. Not only is it an extensible tool providing an astounding amount of checks from the ‘get-go’, but also it provides a GX Cloud interface that serves as a web monitoring tool that is easy to access and navigate for all the people involved.</p><p>Lastly, we wrap Great Expectations code in a Docker container and we run it with Kubernetes Pod Operator on Airflow. This way the Airflow concerns itself only with the scheduling and the runtime layer and all the dependencies needed for the execution are prepared in a separate process of building an image.</p><p>When Data Contract validation fails, the alert is sent. Depending on the tools used in your organization it can be a message to a channel on Slack or Teams or a serious alert in Pager Duty. This is also handled by the custom Python logic in the Docker container.</p><p>Altogether the flow looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ep5EANwP6DyzXs95" /><figcaption>Execution Layer: Scheduled, automated and loud when contracts are violated</figcaption></figure><p>By leveraging this architecture, data contracts can be managed and enforced effectively, ensuring data consistency, compliance, and quality throughout the data lifecycle.</p><h3>Glossary</h3><p>Below you can find more information about the technologies and frameworks that our implementation relies on. Make sure you are familiar with them to have a deep understanding of the architecture of the system.</p><h3>Data Contracts</h3><p>Data contracts, in essence, are agreed-upon specifications or rules regarding data that is shared between systems or components. They define the shape, type, and other properties of the data being exchanged. A data contract assures data consumers about the quality and the form of data they receive from data producers. For more information, you can look at Andrew Jones informal <a href="https://andrew-jones.com/blog/data-contracts/">introduction to data contracts</a> or a more formal <a href="https://dataproducts.substack.com/p/an-engineers-guide-to-data-contracts?utm_source=post-email-title&amp;publication_id=887230&amp;post_id=75344094&amp;isFreemail=true">presentation of data contracts</a> from Chad Sanderson. Also to know more about real-world data contracts systems you can find our previous iteration described <a href="https://www.astrafy.io/articles/data-quality-with-great-expectations">here</a>.</p><h3>Data Producers &amp; Data Consumers</h3><p>Depending on the organization setup and tools Data Producers and Data Consumers may come in different flavors but the core of it stays the same: producers are the ones who make data available to consumers. Note that these are roles, not job titles. In larger organizations, you might find that one Data Consumer is a Data Producer for another team. For example, consider a manufacturing company using SAP and then dbt running on BigQuery. One team, called <em>Alpha</em>, handles SAP to BigQuery ingestion and they are the ultimate Data Producers for the company. The team of analytic engineers called <em>Omicron</em> takes this data and converts them into usable tables with orders, materials, and so on. After that another team, <em>Omega</em> takes this data and creates revenue datasets, while team <em>Sigma</em> creates tables for ML models predicting retail points sales. In this setup, <em>Omicron</em> is both the consumer (it needs data from <em>Alpha</em>) and the producer (serves the data for <em>Omega</em> and <em>Sigma</em>).</p><h3>dbt (Data Build Tool)</h3><p>dbt is an open-source, command-line tool that enables data analysts and engineers to transform data in their warehouses more effectively. It encourages adopting practices from software engineering, like version control, modularity, and testing, in a data analytics workflow. You can find more information about dbt on their <a href="https://www.getdbt.com/product/what-is-dbt/">product page</a> or by following their free online courses, including <a href="https://courses.getdbt.com/courses/fundamentals">dbt fundamentals</a>.</p><h3>Great Expectations</h3><p><a href="https://greatexpectations.io/">Great Expectations</a> is a Python-based open-source library for validating, documenting, and profiling your data. It helps data teams eliminate pipeline debt, through data testing, documentation, and versioning. It supports different backends for running those checks, including in-memory Pandas, Apache Spark, and SQL alchemy, allowing you to plug it into any SQL database you want. On top of that, Great Expectations introduced GX Cloud, which enables your data teams with a web layer that helps track the execution of the validations. You can sign up for the Beta of GX Cloud <a href="https://greatexpectations.io/gx-cloud">here</a>.</p><h3>Data Mesh</h3><p>A data mesh is an architectural paradigm that views data as a product. It emphasizes decentralizing data ownership and architecture, treating domains as sovereign with their data products. It contrasts with the traditional, centralized data lake or data warehouse approach. The best introduction to the concept still serves Zhamak’s (author of the concept) <a href="https://martinfowler.com/articles/data-mesh-principles.html">original article</a> hosted by Martin Fowler on his blog.</p><h3>Data Products</h3><p>Data products are datasets that are designed, built, and managed to be ready for consumption and to provide meaningful insights. They adhere to the needs of the consumers and provide value, similar to any other product. The concept stems from Data Mesh and the idea to treat data as a product. Some compare Data Products to Microservices focusing on the similarities that can be found in the independent development, deployments, and maintenance of the two.</p><p>By understanding these concepts, we can better appreciate the design of our data contract system and how it leverages dbt, Google Cloud, and Great Expectations to ensure data integrity, reliability, and availability.</p><h3>Conclusion</h3><p>In the following parts of this series, we delve into more detail about how these elements interact within our data contract system. You can find <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-2-112c96c2914a">Part 2</a> focusing on the implementation of the data contract management layer and <a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-3-7c2675d549df">Part 3</a> which covers the steps to build the data contract execution layer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=939774fc7284" width="1" height="1" alt=""><hr><p><a href="https://medium.astrafy.io/implementation-of-the-data-contracts-with-dbt-google-cloud-great-expectations-part-1-939774fc7284">Implementation of the Data Contracts with dbt, Google Cloud &amp; Great Expectations: Part 1</a> was originally published in <a href="https://medium.astrafy.io/">Astrafy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging DuckDB for enhanced performance in dbt projects]]></title>
            <link>https://medium.astrafy.io/leveraging-duckdb-for-enhanced-performance-in-dbt-projects-995f535fc230?source=rss-5e2fd2155f5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/995f535fc230</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[duckdb]]></category>
            <dc:creator><![CDATA[Łukasz Ściga]]></dc:creator>
            <pubDate>Fri, 23 Jun 2023 08:00:22 GMT</pubDate>
            <atom:updated>2023-10-24T04:15:08.099Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTfwmUthq7YW1jMALkid9Q.png" /><figcaption>Midjourney: duck carrying tons of paper running super quickly, visible sweat, incredible speed, in a disney animation 3d rendered style, happy upbeat color palette</figcaption></figure><p><strong>dbt</strong> is a robust tool that allows data analysts and engineers to transform data within their warehouses more effectively. However, the efficiency of dbt projects often depends on the choice of the underlying data warehouse. While platforms like Google’s BigQuery offer impressive per-query speed and scalability, the time taken for sequentially executing hundreds or thousands of small queries can still add up to several minutes. An efficient solution to this challenge is <strong>DuckDB</strong>.</p><h4>An Introduction to DuckDB</h4><p>DuckDB is an in-memory analytical database (OLAP) designed to bring SQLite-like simplicity to the world of analytics. DuckDB can directly read data from popular analytical file formats like Parquet and CSV, eliminating the need for cumbersome data import and export processes. Since DuckDB is running locally on your machine there is no need to send data over the network or wait to allocate resources on services like BigQuery.</p><p>With a dbt adapter, it is possible to run dbt models against a DuckDB instance. This integration allows analysts and engineers to leverage the efficiency of DuckDB, cutting down on query execution time and significantly improving the development iteration time. DuckDB makes for a great <strong>local</strong> environment, ‘the default target’ one, on which you work before you deploy your models further.</p><h4>No Setup and No Maintenance</h4><p>One of the most appealing aspects of DuckDB is its simplicity in setup and maintenance. Unlike database systems like Postgres which require configuring users before launching or involve maintenance procedures, setting up DuckDB is as simple as defining the path to a single file. There is no server to launch or any continuous maintenance required. Once you have the file path, you can start interacting with the database immediately.</p><h4>Advantages of Using DuckDB in dbt Projects</h4><p>Integrating DuckDB into dbt projects brings a host of benefits. Firstly, DuckDB’s execution speed is significantly superior to most data warehouses, which leads to faster development iterations. This speed advantage can be a game-changer for projects in need of pace of development with the simultaneous low-to-medium amount of data.</p><p>Speed comparison on the jaffle shop dbt example extended with a couple of additional models (link to the repo at the end of the article).</p><figure><img alt="Screenshot of execution log from dbt run using DuckDB, showing 2.6 seconds execution time" src="https://cdn-images-1.medium.com/max/1024/0*P_skSBI8SHSH9cEO" /><figcaption>DuckDB running 113 models in 2.65s</figcaption></figure><figure><img alt="Screenshot of execution log from dbt run using BigQuery, showing 47 seconds execution time" src="https://cdn-images-1.medium.com/max/1024/0*Wi7kriQ4lHXX0fAl" /><figcaption>BigQuery running the same 113 models in 47.67s</figcaption></figure><p>In this example, it’s more than an order of magnitude (10x) improvement in execution speed.</p><p>(The differences in model numbers in “<em>Finished</em> …” log stems from differences in treating <em>incremental</em> and <em>ephemeral </em>types of models across adapters, most probably. Each <em>dbt run</em> performed 113 executions.)</p><p>Another advantage lies in its single-file architecture, which enables each developer on the team to have their local file. This eliminates the issues commonly associated with shared development or sandbox environments, such as overwriting each other’s data. Every developer can work independently, improving the overall productivity of the team.</p><h4>DuckDB CLI</h4><p>To enhance the user experience further, there is a Command Line Interface (CLI) package, <strong>duckcli</strong>, that manages the connection to the database. <strong>duckcli</strong> allows you to interact with DuckDB using SQL commands, providing a convenient, command-line-based interface for performing database operations.</p><p>After installing the package (for example through pip) to launch the CLI you only need one command:</p><p><em>duckcli -D &lt;path&gt;</em></p><p>Where <em>&lt;path&gt;</em> is the path to your single file DuckDB instance. It will be created if it doesn’t exist, therefore you can use just the filename like <em>db.duckdb.</em></p><p><strong>duckcli</strong> goes out of its way to offer a smooth experience with unusual-style CLI autocompletion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v5_tnFuolTeo7qit" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDYNMJZPWTc8k9Vv" /></figure><h4>DuckDB limitations</h4><p>For starters, it’s important to note that DuckDB didn’t have its 1.0.0 release yet. This means that a lot might change and that some of the parts of DuckDB might not work as expected.</p><p>Considering its infancy, DuckDB is not supported by some of the other tools in the dbt ecosystem, for example <a href="https://www.elementary-data.com/">elementary</a>.</p><p>By definition, DuckDB will not replace your production data warehouse. For its data processing capabilities, it uses a single machine it works on, which means that TB-sized datasets will be too much for it to handle.</p><h4>Getting Started with DuckDB and dbt</h4><p>For those interested in experiencing the integration of DuckDB and dbt firsthand, we have got you covered with a <a href="https://github.com/astrafy/dbt-training-jaffle-shop">GitHub repository</a> similar to the jaffle shop one with some customizations. This repository offers a dbt project setup designed around DuckDB and provides a step-by-step guide on how to utilize DuckDB with dbt.</p><p>To begin, simply follow the QuickStart instructions detailed in the repository’s <a href="https://github.com/astrafy/dbt-training-jaffle-shop/blob/main/README.md">README</a>. These instructions guide you through the process of setting up DuckDB, configuring the dbt project, and running your first dbt model on a DuckDB instance. The repository offers a user-friendly introduction to using DuckDB in a dbt setting, demonstrating the advantages and efficiency of this powerful combination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2nuWVSIAEmwNWTRgxHf-w.png" /><figcaption>Midjourney: duck in a scientist white gown, looking at the chart, in a sci-fi room with matrix style walls, with green fluorescent characters all over the walls, 3d rendered animation style, with happy upbeat colors</figcaption></figure><h4>Conclusion</h4><p>If you need help with long execution times for your development dbt executions, consider introducing DuckDB. It can significantly improve the performance of dbt runs. Use <strong>duckcli</strong> to access the data in the database instance.</p><p>If you would like support with setting up this or other aspects of the Data Stack at your organization, do not hesitate to reach out to <a href="/service/mailto:sales@astrafy.io">sales@astrafy.io</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=995f535fc230" width="1" height="1" alt=""><hr><p><a href="https://medium.astrafy.io/leveraging-duckdb-for-enhanced-performance-in-dbt-projects-995f535fc230">Leveraging DuckDB for enhanced performance in dbt projects</a> was originally published in <a href="https://medium.astrafy.io/">Astrafy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>