<?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 Getachew Abebe Agegnehu on Medium]]></title>
        <description><![CDATA[Stories by Getachew Abebe Agegnehu on Medium]]></description>
        <link>https://medium.com/@GetachewAbebe?source=rss-a58b43515f43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T2FjIFbrOJiN9Y4HIyq5NQ.png</url>
            <title>Stories by Getachew Abebe Agegnehu on Medium</title>
            <link>https://medium.com/@GetachewAbebe?source=rss-a58b43515f43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:14:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@GetachewAbebe/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[Logistic Optimization: Delivery Drivers Location Optimization with Causal Inference]]></title>
            <link>https://medium.com/@GetachewAbebe/logistic-optimization-delivery-drivers-location-optimization-with-causal-inference-e08b60942276?source=rss-a58b43515f43------2</link>
            <guid isPermaLink="false">https://medium.com/p/e08b60942276</guid>
            <category><![CDATA[delivery-company]]></category>
            <category><![CDATA[logistics-optimization]]></category>
            <category><![CDATA[causal-inference]]></category>
            <dc:creator><![CDATA[Getachew Abebe Agegnehu]]></dc:creator>
            <pubDate>Sat, 15 Jun 2024 09:23:12 GMT</pubDate>
            <atom:updated>2024-06-24T08:42:46.169Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we’ll embark on a data-driven investigation to get to the bottom of Gokada’s delivery issues. To do this, we’ll employ causal inference, a powerful statistical approach that helps us identify the underlying causes of a problem, rather than just its symptoms. By applying causal inference, we’ll be able to distinguish between correlations and true cause-and-effect relationships, ultimately uncovering the root factors driving Gokada’s delivery challenges. This will enable us to develop targeted solutions that address the heart of the problem, rather than just its surface-level effects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*mUiXxU9lnIv0PjbxMLq99Q.png" /></figure><h3>Objective</h3><p>Gokada is the largest last-mile delivery service in Nigeria, partnering with motorbike owners and drivers (called “pilots”) to deliver parcels across Lagos. The company has seen tremendous growth, completing over a million deliveries in less than a year with a fleet of over 1,200 riders.</p><p>However, Gokada has faced a key challenge as it expands its service — the sub-optimal placement of its pilots and clients requesting deliveries. This has led to a high number of unfulfilled delivery requests, which is a significant issue for the company’s operations and customer satisfaction.</p><p>As 10 Academy trainees, your task is to work with Gokada’s data to help the company understand the primary causes of these unfulfilled requests. Additionally, you need to provide solutions that recommend the optimal locations to place Gokada’s pilots to increase the fraction of completed orders.</p><h3>Data Overview:</h3><p>For this challenge we have two different datasets:</p><p><strong>Completed Orders Dataset: </strong>The first datasets have the completed order in the company with the following columns: <strong>536020</strong> rows of data</p><ul><li><strong>Trip ID:</strong> Unique identifier for each trip</li><li><strong>Trip Origin:</strong> Address where the trip started</li><li><strong>Trip Destination: </strong>Address where the trip ended</li><li><strong>Trip Start Time:</strong> Timestamp indicating when the trip started</li><li><strong>Trip End Time: </strong>Timestamp indicating when the trip ended</li></ul><p><strong>Delivery Requests Dataset: </strong>The second dataset have delivery requests made by clients(both completed and unfulfilled), the dataset have the following columns: <strong>1557740</strong> rows of data</p><ul><li><strong>ID: </strong>Unique identifier for each delivery request</li><li><strong>Order ID:</strong> Unique identifier for the order</li><li><strong>Driver ID:</strong> Unique identifier for the driver assigned to the delivery</li><li><strong>Driver Action:</strong> Indicates whether the driver accepted or rejected the delivery request</li><li><strong>Latitude (Lat) and Longitude (Lng):</strong> Coordinates of the delivery location</li><li><strong>Created At:</strong> Timestamp indicating when the delivery request was created</li><li><strong>Updated At: </strong>Timestamp indicating when the delivery request was last updated</li></ul><p><strong>Implementation Methodology</strong></p><p>Exploratory Data Analysis(EDA)</p><p>EDA is a crucial step in the data analysis process as it allows us to understand the dataset, its characteristics, and the relationships between the variables. This will provide us with valuable insights that can guide our subsequent modeling and decision-making tasks.</p><p>The first data set is clear and doesn&#39;t have any missing values as per displayed below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*rCO-tR2d8b39tj4HtE9ZtQ.png" /></figure><p>The second dataset looks like the following which has missing values for two columns, this two columns will be dropped for the data analysis step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*8epeS7ff_nkFYEN_LY7nMA.png" /></figure><h3><strong>Challenges</strong></h3><p>Understanding the concept of Causal Inference was not an easy job. It takes me a while to understand the core concept.</p><h3><strong>Future Tasks</strong></h3><p>In the interest of time, we can’t go through all the expected, so in the future. I have a plan to go through all the expected analysis results and model training.</p><h3><strong>Causal Inference</strong></h3><p>Now that our data is ready, we can start building a causal inference model to uncover the underlying causes of order fulfillment outcomes. We’ll use the <strong><em>Causalnex</em></strong> library, a powerful tool for identifying and analyzing causal relationships. Our goal is to create a model that reveals the hidden patterns driving successful or failed deliveries.</p><p>The first step is to create a causal graph, a visual representation of how we think the variables are related. Based on our understanding of the business and industry, we suspect that factors like the time of day, driver location, and trip distance might impact order fulfillment. We’ll draw a graph that reflects these relationships.</p><p>Next, we’ll use causal discovery algorithms to refine our graph and identify potential causal relationships that we might have missed. This step helps us validate our initial assumptions and uncover hidden dependencies between variables.</p><p>Once we have a refined graph, we’ll perform intervention analysis using do-calculus. This technique allows us to simulate the effect of changing a specific variable, such as driver location, while keeping everything else constant. This helps us understand the true causal impact of that variable on order fulfillment.</p><p>Finally, we’ll integrate machine learning models with our causal inference framework. This will enable us to predict the outcome of deliveries under different scenarios and test the robustness of our causal conclusions. By combining causal inference with machine learning, we can gain a deeper understanding of the causal relationships driving order fulfillment and make more accurate predictions</p><p><strong>Building the Causal Graph</strong></p><p>As we discussed earlier, the first step in our causal inference journey is to create a causal graph that illustrates our initial hypotheses about the relationships between variables. This graph is a visual representation of how we think the different factors interact and influence each other.</p><p>To create this graph, we’ll use a directed acyclic graph (DAG) framework. In a DAG, each node represents a variable, and the arrows between nodes indicate the direction of causality. In other words, an arrow pointing from node A to node B suggests that node A has a causal influence on node B. By structuring our graph in this way, we can begin to tease apart the complex relationships between variables and identify potential causes and effects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*CM5gg0JnNrZYSEDsVW66UQ.png" /></figure><h3><strong>Conclusion</strong>: Unlocking the Power of Causal Inference for Gokada’s Delivery Optimization</h3><p>The ultimate goal of this exercise is to uncover the underlying causal relationships driving Gokada’s unfulfilled delivery requests. By achieving this, we can develop targeted solutions to improve the efficiency and reliability of their delivery service, leading to enhanced customer satisfaction and business growth.</p><p>By applying causal inference techniques, such as logistic regression, we can move beyond mere correlation and uncover the true causes of delivery issues. This knowledge will empower Gokada to make data-driven decisions, optimize their operations, and stay ahead of the competition.</p><p>In conclusion, this post has provided a glimpse into the transformative power of causal inference in the context of Gokada’s delivery optimization. As we continue to explore and apply these techniques, we can unlock new insights, drive business growth, and create a better experience for customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e08b60942276" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Precision RAG: Prompt Tuning For Building Enterprise Grade RAG Systems]]></title>
            <link>https://medium.com/@GetachewAbebe/precision-rag-prompt-tuning-for-building-enterprise-grade-rag-systems-41dd27cfbe72?source=rss-a58b43515f43------2</link>
            <guid isPermaLink="false">https://medium.com/p/41dd27cfbe72</guid>
            <category><![CDATA[prompt-tuning]]></category>
            <category><![CDATA[precision]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[precision-rag]]></category>
            <category><![CDATA[generative-ai]]></category>
            <dc:creator><![CDATA[Getachew Abebe Agegnehu]]></dc:creator>
            <pubDate>Sat, 08 Jun 2024 10:43:03 GMT</pubDate>
            <atom:updated>2024-06-11T02:10:55.243Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog will explore building an AI-powered prompt tuning system for Retrieval Augmented Generation (RAG) in an enterprise setting. RAG systems combine information retrieval and language models to revolutionize business knowledge access, but their effectiveness depends on prompt quality. We’ll walk through the key steps to develop an enterprise RAG system using the LangChain framework and OpenAI’s language models.</p><p><strong>Business Objective</strong></p><blockquote>PromptlyTech’s objective is to empower businesses to harness the full potential of Language Models by providing efficient and effective prompt engineering solutions, thereby enhancing decision-making, operational efficiency, and customer experience across various industries. Our mission is to make advanced AI capabilities more accessible and user-friendly, while ensuring speed, accuracy, and relevance in LLM applications.</blockquote><p><strong>Focus Areas of the Project</strong></p><ol><li>Automatic Prompt Generation</li><li>Automatic Evaluation Data Generation</li><li>Prompt Testing and Ranking</li></ol><p><strong>Teck Stacks Used for this Project</strong></p><p><strong>LangChain: </strong>A framework for developing LLM applications, simplifying integration of language models, prompts, and retrieval.<br><strong>OpenAI’s GPT Models:</strong> Cutting-edge language models like GPT-4 and GPT-3.5-Turbo for generating prompts, answering queries, and evaluating responses.<br><strong>FAISS (Facebook AI Similarity Search): </strong>A library for efficient similarity search and clustering of dense vectors, used for document retrieval.<br><strong>Ragas:</strong> A Python library for evaluating RAG pipelines and assessing generated answer quality and relevance.<br><strong>Python:</strong> The programming language used to implement the prompt tuning system logic.<br><strong>Sentence Transformers: </strong>A library for generating semantic text embedding.</p><p><strong>Project Implementation</strong></p><p>Firstly, lets read our sample pdf file and embed it using FIASS and change it to a vector database. This database will be used in this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*jLGXSdgwtu5wPsvPy4uQbA.png" /></figure><p><strong>Context Retrieval</strong></p><p>We have a given context to be used for prompt generation and this context will be overwritten with every cycle of the application running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*JAnFOFHZQvDlzr5cUTmQIg.png" /></figure><p><strong>Generating Prompt</strong></p><p>Here we define functions for generating test data based on a given prompt, context, and the number of desired test outputs. The generate_test_data function makes an API call to obtain completions, and the resulting data is saved in JSON format using the save_json function. The main function, will retrieve context information from the input text which is user query. Based on that context the function generates prompts of fixed number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6KHGQ2lnwqEL01aT0cnRtg.png" /></figure><p>The generated prompt for a user who searched with “<strong>schedule</strong>” looks like the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SmJE2-Ut4ve0sV8X19zU9Q.png" /></figure><p><strong>Prompt Evaluation</strong></p><p>For the evaluation of generated prompts, we defines an evaluate function that assesses the adequacy of context for answering user questions using the GPT-3.5-turbo model. It replaces placeholders in a prompt with provided context and user messages, logs system responses, log probabilities, and calculates accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nq674rk008_vDt-Hl7dQ5g.png" /></figure><p>The output of prompt evaluation with the search query “schedule” is the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiPCjYiHmOxybw0mlBEhiA.png" /></figure><p><strong>Prompt Ranking — </strong>Monte Carlo Matchmaking and ELO</p><p>The Monte Carlo Matchmaking method is used to select and match different prompt candidates against each other. It simulates various match ups to test the effectiveness of each prompt in different scenarios, optimizing the information gained from each battle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*xTCb9YjKlc-F1PL26T2vMw.png" /></figure><p>The ELO Rating System rates prompt candidates based on their performance in these battles, assigning a rating reflecting their success in previous match ups, taking into account not just the number of wins but also other factors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*yenTq6ODF-amVejZVlKGKw.png" /></figure><p>The following image shows the ranking result of Generated prompts with the user query “schedule”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2WJwuEXU77SmwBpl0mUEw.png" /></figure><p><strong>User Interface</strong></p><p>The user interface is designed for the user to access the developed PrecisionRAG easily. Any one in need of this project can clone the repository.</p><pre>git clone https://github.com/GetachewAbebe/PrecisionRAG.git</pre><p>Install Requirements</p><pre>pip install -r requiremnts.txt</pre><p>Then He/She can run the app with the following command</p><pre>streamlit run app.py</pre><p>After successful build the following page will be displayed. The user interface has three main buttons for the three actions in this project and there is a file upload option(which is not functional for the time being) and there is a search history display part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImMUgZme0bc8PNDBT3r1XA.png" /></figure><p><strong>Conclusion</strong></p><p>Automating prompt tuning for enterprise RAG systems is crucial for maximizing their effectiveness. By leveraging language models to generate a variety of prompts and test cases, and then using ELO rankings and metrics like RAGAs and embedding similarity, businesses can significantly improve the accuracy and efficiency of their RAG systems. This approach streamlines development, minimizes manual intervention, and allows for continuous improvement and adaptation to evolving business needs.</p><p><strong>Future Work</strong></p><p><strong>User-Centric Customization:</strong></p><ul><li>Empower users with greater control over prompt customization, allowing them to tailor the prompt generation process to their specific needs and preferences. This creates a more personalized and effective experience.</li></ul><p><strong>Continuous Model Training:</strong></p><ul><li>Implement a system for ongoing training of the Language Model (LLM), ensuring it stays up-to-date with evolving user needs and industry trends. This guarantees the system remains relevant and performs optimally over time.</li></ul><p><strong>Advanced Evaluation Metrics:</strong></p><ul><li>Explore and integrate cutting-edge evaluation metrics, leveraging the latest advancements in natural language processing and machine learning. This will enable more nuanced and sophisticated assessments of prompt quality, leading to better insights and improvements</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41dd27cfbe72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Warehouse Tech Stack - PostgreSQL, DBT, Airflow]]></title>
            <link>https://medium.com/@GetachewAbebe/data-warehouse-tech-stack-postgresql-dbt-airflow-8efc4a884afe?source=rss-a58b43515f43------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efc4a884afe</guid>
            <category><![CDATA[data-ware-housing]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[redash]]></category>
            <category><![CDATA[dbt]]></category>
            <dc:creator><![CDATA[Getachew Abebe Agegnehu]]></dc:creator>
            <pubDate>Sat, 04 May 2024 19:42:13 GMT</pubDate>
            <atom:updated>2024-05-04T19:42:13.727Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Table of Content</strong></p><ol><li>Overview</li><li>Airflow</li><li>PostgreSQL</li><li>DBT</li><li>Redash</li><li><strong>Overview</strong></li></ol><p>A data warehouse, also known as a unified data repository, is a system that data engineers use to make data accessible so that organizations can analyze and optimize their performance. The ETL (Extract, Transform, Load) process is a key component of data warehousing, as it combines data from various sources and loads it into the data warehouse.</p><p>It serves as a centralized repository that consolidates and stores historical data from various sources across an organization. It transforms the raw data into a structured, cleaned, and organized format that is optimized for business analysis, reporting, and decision-making.</p><p><strong>The key functions of a data warehouse include:</strong></p><p><strong>Data Integration:</strong> A data warehouse gathers and integrates data from multiple disparate sources, such as operational systems, databases, and external sources, into a unified and consistent format.</p><p><strong>Data Transformation:</strong> The data warehouse processes and transforms the raw data to ensure it is accurate, consistent, and suitable for analytical purposes. This includes tasks like data cleansing, normalization, and enrichment.</p><p><strong>Data Storage: </strong>The data warehouse provides a secure and scalable storage solution for the consolidated, transformed, and historical data, making it readily available for reporting and analysis.</p><p><strong>Analytics and Reporting:</strong> The data stored in the data warehouse is designed to support complex analytical queries, enabling organizations to generate insightful reports, dashboards, and business intelligence to drive informed decision-making.</p><p><strong>Separation of Workloads: </strong>By separating the analytical workload from the operational transactional workload, the data warehouse helps to maintain the performance and efficiency of the overall system, ensuring that critical business operations are not impacted by the resource-intensive analytical tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaKY_SDjfX80jyETjFMRog.jpeg" /><figcaption>ETL Process Diagram</figcaption></figure><p><strong>2. Airflow</strong></p><p>Airflow is an open-source workflow management platform created by Airbnb. It is designed to programmatically author, schedule, and monitor data pipelines, making it a popular tool in the data engineering and data science communities.</p><p><strong>Workflow Orchestration:</strong></p><p>Airflow allows you to define and manage data workflows as Directed Acyclic Graphs (DAGs), which are collections of tasks with dependencies between them.<br>These DAGs are written in Python, providing a programmatic and extensible way to define your data pipelines.<br><strong>Scheduling and Execution:</strong></p><p>Airflow can schedule and execute your data pipelines on a regular basis, such as hourly, daily, or weekly.<br>It also supports triggering pipelines in response to specific events or external signals.<br>Airflow ensures that your pipelines are executed in the correct order, respecting the dependencies between tasks.</p><p><strong>Monitoring and Alerting:</strong></p><p>Airflow provides a web-based UI that allows you to view the status of your pipelines, monitor task execution, and troubleshoot issues.<br>It supports alerts and notifications, such as email or Slack, to inform you of pipeline failures or other important events.</p><p><strong>step by step installation</strong></p><p><strong>Install Docker:</strong> If you haven’t already, install Docker on your system. The installation process varies based on your operating system. You can follow the official Docker installation guide for your platform: https://docs.docker.com/get-docker/</p><p>Create a working directory: Create a directory where you will store your Airflow-related files, for example:</p><pre>bash<br>Copy<br>mkdir airflow<br>cd airflow<br>Create a Docker Compose file: In the airflow directory, create a file named docker-compose.yml with the following content:</pre><p>create “docker-compose” yaml file in your working directory and paste the following code:<br>services:</p><pre>version: &#39;3&#39;<br>x-airflow-common:<br>  &amp;airflow-common<br>  image: apache/airflow:2.3.3<br>  environment:<br>    &amp;airflow-common-env<br>    AIRFLOW__CORE__EXECUTOR: CeleryExecutor<br>    AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow<br>    AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow<br>    AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0<br>    AIRFLOW_VERSION: 2.3.3<br>    PYTHON_VERSION: 3.7<br>    CONSTRAINTS_BRANCH: 2.3.3<br>  volumes:<br>    - ./dags:/opt/airflow/dags<br>    - ./logs:/opt/airflow/logs<br>    - ./plugins:/opt/airflow/plugins<br>  user: &quot;${AIRFLOW_UID:-50000}:0&quot;<br>  depends_on:<br>    postgres:<br>      condition: service_healthy<br>    redis:<br>      condition: service_healthy<br><br>services:<br><br>  postgres:<br>    image: postgres:13<br>    environment:<br>      POSTGRES_USER: airflow<br>      POSTGRES_PASSWORD: airflow<br>      POSTGRES_DB: airflow<br>    volumes:<br>      - postgres-db-volume:/var/lib/postgresql/data<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;pg_isready&quot;, &quot;-U&quot;, &quot;airflow&quot;]<br>      interval: 5s<br>      retries: 5<br>    restart: always<br><br>  redis:<br>    image: redis:latest<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;redis-cli&quot;, &quot;ping&quot;]<br>      interval: 5s<br>      timeout: 30s<br>      retries: 5<br>    restart: always<br><br>  airflow-webserver:<br>    &lt;&lt;: *airflow-common<br>    command: webserver<br>    ports:<br>      - 8080:8080<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;curl&quot;, &quot;--fail&quot;, &quot;http://localhost:8080/health&quot;]<br>      interval: 10s<br>      timeout: 10s<br>      retries: 5<br><br>  airflow-scheduler:<br>    &lt;&lt;: *airflow-common<br>    command: scheduler<br>    healthcheck:<br>      test: [&quot;CMD-SHELL&quot;, &#39;airflow jobs check --job-type SchedulerJob --duration 5m --check-stakes 1 2&gt;&amp;1 | grep &quot;No issues detected&quot;&#39;]<br>      interval: 5s<br>      timeout: 10s<br>      retries: 5<br><br>  airflow-worker:<br>    &lt;&lt;: *airflow-common<br>    command: celery worker<br>    healthcheck:<br>      test: [&quot;CMD-SHELL&quot;, &#39;celery --app airflow.executors.celery_executor.app inspect ping -d &quot;celery@$${HOSTNAME}&quot;&#39;]<br>      interval: 10s<br>      timeout: 10s<br>      retries: 5<br><br>  airflow-init:<br>    &lt;&lt;: *airflow-common<br>    command: version<br>    environment:<br>      &lt;&lt;: *airflow-common-env<br>      _AIRFLOW_DB_UPGRADE: &#39;true&#39;<br>      _AIRFLOW_WWW_USER_CREATE: &#39;true&#39;<br>      _AIRFLOW_WWW_USER_USERNAME: airflow<br>      _AIRFLOW_WWW_USER_PASSWORD: airflow<br><br>  flower:<br>    &lt;&lt;: *airflow-common<br>    command: celery flower<br>    ports:<br>      - 5555:5555<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;curl&quot;, &quot;--fail&quot;, &quot;http://localhost:5555/&quot;]<br>      interval: 10s<br>      timeout: 10s<br>      retries: 5<br><br>volumes:<br>  postgres-db-volume:<br>Start the Airflow containers: Run the following command to start the Airflow services:</pre><p>use the following command to start airflow in your docker</p><pre>docker-compose up -d</pre><p>This command will start the following Docker containers:</p><blockquote>postgres: The PostgreSQL database for Airflow’s metadata.<br>redis: The message broker used by the Celery executor.<br>airflow-webserver: The Airflow webserver.<br>airflow-scheduler: The Airflow scheduler.<br>airflow-worker: The Airflow worker.<br>airflow-init: The Airflow initialization container.<br>flower: The Celery flower monitoring tool.</blockquote><p>Initialize the Airflow database: Run the following command to initialize the Airflow database:</p><pre>docker-compose run --rm airflow-init</pre><p>This will create the necessary Airflow tables in the PostgreSQL database. Access the Airflow webserver: Once the containers are up and running, you can access the Airflow webserver at <a href="http://localhost:8080.">http://localhost:8080.</a> The default login credentials are:</p><pre><br>Username: airflow<br>Password: airflow</pre><p>3. <strong>PostgreSQL</strong></p><p>Airflow provides various operators and hooks that allow you to interact with Postgres databases as part of your data pipelines.<br>You can use Airflow to execute SQL queries against Postgres for tasks such as data extraction, transformation, and loading (ETL) operations.<br>This integration between Airflow and Postgres enables seamless data processing and movement within your data workflows.</p><p>Use the following command to create new Database:</p><pre>Create a new container named postgres-db</pre><p>Run the following command to check if the PostgreSQL container is running:</p><pre>docker ps</pre><p>4. <strong>DBT</strong></p><p>DBT (Data Build Tool) is a powerful open-source data transformation tool that allows you to build and manage your data pipelines in a declarative way. Here’s an overview of what DBT is and how it works:</p><p><strong>Declarative Data Transformation:</strong></p><p>DBT allows you to define your data transformations in a declarative manner, using SQL-like syntax.<br>Instead of writing procedural code to transform data, you define the desired end result, and DBT handles the execution and management of the transformations.<br><strong>Version Control and Collaboration:</strong></p><p>DBT integrates well with version control systems like Git, allowing you to manage your data transformations as code.<br>This enables teams to collaborate on data projects, track changes, and ensure consistency across different environments.<br><strong>Data Modeling and Documentation:</strong></p><p>DBT helps you build data models, which are representations of your data structures and relationships.<br>These data models can be easily documented and shared with stakeholders, improving transparency and understanding of your data ecosystem.<br><strong>Testing and Validation:</strong></p><p>DBT provides built-in testing capabilities, allowing you to define tests for your data transformations to ensure data quality and integrity.<br>These tests can be run automatically as part of your data pipeline, catching issues before they propagate downstream.<br><strong>Deployment and CI/CD:</strong></p><p>DBT can be integrated with Continuous Integration and Continuous Deployment (CI/CD) pipelines, enabling you to automate the deployment of your data transformations.<br>This helps to streamline the process of getting new data changes into production.</p><p>Installation process: the following command will install DBT on your system</p><pre>pip install dbt-postgres</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FpGeFS7mwNzsOnWxn3xA1Q.png" /><figcaption>DBT Successfully installed on my working machine</figcaption></figure><p>After successful installation of DBT, I run three queries and they are successfully operational.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*APv4isInK6r2r4ruIi1P1A.png" /><figcaption>DBT RUN Success</figcaption></figure><p><strong>5. Redash</strong></p><p>Redash is a data engineering tool that is used to create dashboards and visualize the outcomes of querying database tables. It is a popular open-source tool that allows users to easily set up and manage their data visualization needs.</p><p><strong>Configuring the Data Source:</strong></p><blockquote>Log in to your Redash account.<br>Access the Data Source settings.<br>Configure the connection details to your data warehouse.<br>Add this data source to Redash.</blockquote><p><strong>Writing Queries:</strong></p><blockquote>Access the Redash query editor.<br>Use queries to extract and manipulate data from your source.<br>Queries allow you to prepare the data before visualizing it.</blockquote><p><strong>Creating Visualizations:</strong></p><blockquote>From the query editor, create new visualizations.<br>Configure the visualization options to display the data appropriately.<br>Visualize the results of your configuration in real-time.</blockquote><p><strong>Creating Dashboards:</strong></p><blockquote>Access the Redash dashboard creation functionality.<br>Name your new dashboard.<br>Add the previously created visualizations to your dashboard.<br>Your dashboard is now ready to be used.</blockquote><p><strong>What are the challenges?</strong></p><p>The challenges are understanding this tech stack for Data Warehousing — most of the technologies are new and complex for me, so that it take me time to understand installation process was one of the challenges in this project.</p><p><strong>What can be improved with more time?</strong></p><blockquote>code structure can be improved</blockquote><blockquote>better organized code can be written</blockquote><blockquote>better understanding of this technologies for better coding.</blockquote><p><strong>References</strong></p><ul><li><a href="https://redash.io/">https://redash.io/</a></li><li><a href="https://www.getdbt.com/">https://www.getdbt.com/</a></li><li><a href="https://www.postgresql.org/">https://www.postgresql.org/</a></li><li><a href="https://docs.getdbt.com/reference/commands/cmd-docs">https://docs.getdbt.com/reference/commands/cmd-docs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efc4a884afe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>