<?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 Furkan Yusuf Pek on Medium]]></title>
        <description><![CDATA[Stories by Furkan Yusuf Pek on Medium]]></description>
        <link>https://medium.com/@furkanyusufpek?source=rss-10c770be067c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UwYeZe_K6Q3N8YEp2gC9hA.jpeg</url>
            <title>Stories by Furkan Yusuf Pek on Medium</title>
            <link>https://medium.com/@furkanyusufpek?source=rss-10c770be067c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:16:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@furkanyusufpek/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[Strengthening Security in Data Warehousing and Business Intelligence]]></title>
            <link>https://medium.com/cstech/strengthening-security-in-data-warehousing-and-business-intelligence-with-delinea-password-vault-9c1cc17d64db?source=rss-10c770be067c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c1cc17d64db</guid>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Furkan Yusuf Pek]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 07:26:05 GMT</pubDate>
            <atom:updated>2023-08-23T08:56:08.941Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digital world, where data is incredibly valuable, security is a big concern for developers. This is especially true for Data Engineering (DE) and Business Intelligence (BI) professionals who work with different data systems. In this article I will try to explain how Delinea Password Vault can help Data Engineers and BI experts improve security and protect sensitive information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P08YAJnRLkpYgdvvaQrohQ.png" /></figure><p>The Special Challenges in DE and BI perspective: People working in Data Engineering and Business Intelligence face unique security challenges due to the kind of work they do:</p><ol><li><strong>Working with Lots of Data:</strong> Unlike some developers who deal with a few databases, DE and BI folks handle many databases, cloud services, and systems.</li><li><strong>Protecting Sensitive Data:</strong> The information we work with is often private, like customer data or business secrets. If this data gets into the wrong hands, it can cause serious problems.</li><li><strong>Complex Access Needs:</strong> Data Engineers often need different levels of access to different systems, which makes managing who can access what quite tricky.</li><li><strong>Complex Pipelines:</strong> Data moves through complicated pipelines with different steps, tools, and systems. Keeping this data safe as it moves around is tough.</li><li><strong>Handling Passwords:</strong> Keeping track of many passwords for different systems and regularly changing them is hard and time-consuming.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XW1SPOS4HhUBPZj8CxPgXQ.jpeg" /><figcaption>Password Vault</figcaption></figure><h3>Password Vault</h3><p>To ensure security to access for these databases there must be mechanism to prevent hard coded username and passwords in our codes. Also this approach is good for password rotation. At that point password vaults are perfect fit for our issue.</p><p>Password vault is a <a href="https://delinea.com/what-is/privileged-access-management-pam">PAM solution</a> that stores your username and passwords and you can programmaticly access these passwords by using it.</p><h3>Delinea Password Vault: A Security Solution</h3><p><a href="https://delinea.com/">Delinea</a> Password Vault is a solution to the many security challenges faced by Data Engineers and BI professionals. It’s a secure place to keep important information, like passwords, keys, and tokens, cloud credentials, service accounts etc. Here’s how it helps:</p><ol><li><strong>Keeping Things Together:</strong> Delinea puts all the passwords in one place instead of scattering them around. This makes it easier to control who can get access and when to change passwords.</li><li><strong>Extra Protection:</strong> The information in Delinea is locked up using special codes. Even if someone gets in, they won’t be able to understand the information.</li><li><strong>Picking Who Gets What:</strong> Delinea lets you decide who can use which passwords. This means only the right people can get to sensitive information.</li><li><strong>Watching Closely:</strong> Delinea keeps track of who uses what passwords and when. This helps keep an eye on things and find out if something unusual happens.</li><li><strong>Automatic Changes:</strong> Delinea can change passwords automatically, which is important for security. People don’t have to do it manually.</li><li><strong>Fitting In Easily:</strong> Delinea works smoothly with common tools Data Engineers and BI professionals use. It fits into their work without causing problems.</li></ol><h3>Using python-tss-sdk : Easy Access</h3><p>With the <a href="https://github.com/DelineaXPM/python-tss-sdk">python-tss-sdk</a>, Data Engineers and BI experts can easily get the passwords they need from Delinea. This toolkit makes it simpler to work with Delinea and include secure passwords in their work.</p><p>With the python-tss-sdk, Data Engineers and BI experts can easily get the passwords they need from Delinea. This toolkit makes it simpler to work with Delinea and include secure passwords in their work.</p><pre><br>from delinea.secrets.server import SecretServerCloud<br>from delinea.secrets.server import PasswordGrantAuthorizer<br><br># base url for secret server cloud and credentials<br>tenant_id = &quot;&quot;<br>base_url = f&quot;https://{tenant_id}.secretservercloud.com/&quot;<br><br># store this credentials in environment file<br># and restrict access to this file from OS level<br>master_username = &quot;&quot;<br>master_password = &quot;&quot;<br><br># path os the key from delinea<br># example \Personal Folders\passwords\mysql<br>path_of_key = &quot;&quot;<br><br># create authorizer from master credentials<br>authorizer = PasswordGrantAuthorizer(base_url, master_username, master_password)<br>secret_server = SecretServerCloud(tenant_id, authorizer)<br> <br># return server info from delinea<br>def get_db_credentials(path):<br>    secret = secret_server.get_secret_by_path(path_of_key)<br>    server = secret.get(&quot;items&quot;)[0][&quot;itemValue&quot;]<br>    username = secret.get(&quot;items&quot;)[1][&quot;itemValue&quot;]<br>    password = secret.get(&quot;items&quot;)[2][&quot;itemValue&quot;]<br><br>    credentials = {<br>        &quot;server&quot; : server,<br>        &quot;username&quot; : username,<br>        &quot;password&quot; : password<br>    }<br><br>    return credentials</pre><p>Above function can be used while fetching data from any database. While using connection string this function can be used like this;</p><pre>from urllib.parse import quote<br>from sqlalchemy import create_engine<br>from util import get_db_credentials<br><br># name of the secret from delinea<br>secret_name = &quot;&quot;<br><br># retrive credentials using function<br>db_credentials = get_db_credentials(secret_name)<br><br>login = db_credentials[&quot;username&quot;]<br>password = db_credentials[&quot;password&quot;]<br>host = db_credentials[&quot;server&quot;]<br>schema = &quot;&quot;<br><br># create pymysql connection with credentials<br>def get_pymysql_connection_engine(login, password, host):<br>    print(&#39;creating pymysql connection ..&#39;)<br>    engine = create_engine(<br>        &#39;mysql+pymysql://{username}:{pw}@{host}/{schema}&#39;.format(username=login,<br>                                                                 pw=quote(password),<br>                                                                 host=host,<br>                                                                 schema=schema))<br><br>    print(&#39;engine is ready&#39;)<br>    return engine</pre><p>In addition you can get the password and username via sdk, but to retrive json-key from delinea, you need to implement below code.</p><pre>from delinea.secrets.server import PasswordGrantAuthorizer<br>import requests<br><br># base url for secret server cloud and credentials<br>base_url = &quot;&quot;<br>username = &quot;&quot;<br>password = &quot;&quot;<br><br># generate authorizer from credentials<br>authorizer = PasswordGrantAuthorizer(base_url, username, password)<br># retrieve access token<br>token = authorizer.get_access_token()<br><br># build bearer token for request<br>token_bearer = f&quot;Bearer {token}&quot;<br># build header for request<br>header = {&quot;Authorization&quot;: token_bearer, &#39;Content-Type&#39;: &#39;application/json&#39;}<br><br># input secret id for json private key<br>secret_id = 123<br>slug = &quot;json-private-key&quot;<br><br># secret json retrieved from api endpoint<br>secret_url = f&quot;{base_url}api/v1/secrets/{secret_id}/fields/{slug}&quot;<br><br># make api call and retrieve json secret<br>resp = requests.get(secret_url, headers=header)<br>print(resp.text)</pre><p><strong>Conclusion:</strong> For people in Data Engineering and Business Intelligence, security is super important. Delinea Password Vault is like a superhero in this story, helping us keep our data safe. But remember, Delinea isn’t the only thing needed for security. It’s like a part of a bigger plan that also includes other safety practices like strong passwords, keeping bad guys out, and regularly checking for problems.</p><p>As the world of data keeps changing and bad guys get smarter, Data Engineers and BI experts can trust tools like Delinea to keep their data safe and earn the trust of the people who rely on them.</p><p>Thanks for reading and for your time, you can always reach me via <a href="https://www.linkedin.com/in/furkan-yusuf-pek/">LinkedIn</a>. 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c1cc17d64db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/strengthening-security-in-data-warehousing-and-business-intelligence-with-delinea-password-vault-9c1cc17d64db">Strengthening Security in Data Warehousing and Business Intelligence</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Selenium Power BI ScreenShot]]></title>
            <link>https://medium.com/cstech/python-selenium-power-bi-screenshot-8d37018f3fc2?source=rss-10c770be067c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d37018f3fc2</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[Furkan Yusuf Pek]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 11:26:24 GMT</pubDate>
            <atom:updated>2023-03-24T18:21:06.047Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*OTgt_bbFxC_x-FzlrUf11w.png" /><figcaption>Python Selenium Power BI</figcaption></figure><p>From time to time, every data pipeline needs to be checked and if something is wrong, there must be alerting mechanism to make sure report stakeholders to see the right data. Also, these checks are important for data reliability.</p><p>My motto is if I am gonna repeat something more than three times, I try to automate it.</p><p>From that motto, I came up with the idea of Power BI selenium screenshots for daily report checks.</p><p><a href="https://selenium-python.readthedocs.io/">Python selenium</a> is a powerful library that enables you to grab a screenshot of any web page. Also, you can mimic users’ behaviors like clicking buttons, filling out forms, etc. With that capabilities, I decided to automate our daily report checks with python selenium.</p><p>The main challenge here is when you try to grab a screenshot of a report, you need to log in to the Power BI portal using your credentials. You can’t simply get a screenshot of a page.</p><p>There are several things to make a screenshot of a Power BI report using selenium. First, we need to navigate to the login page for Power BI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*YB-msAv8ewOJsSRdpF53Cg.png" /><figcaption>PowerBI Login Page</figcaption></figure><p>When we navigate to <a href="http://app.powerbi.com/">app.powerbi.com</a> we need to fill in our email account. With selenium’s user mimic capabilities, we can fill that form. After filling email we need to hit submit button and selenium can do this for us.</p><pre># powerbi login url<br>driver.get(&#39;https://app.powerbi.com/?noSignUpCheck=1&#39;)<br># wait for page load<br>time.sleep(2)<br># find email area using xpath<br>email = driver.find_element_by_xpath(&#39;//*[@id=&quot;i0116&quot;]&#39;)<br># send power bi login user<br>email.send_keys(pbi_user)<br># find submit button<br>submit = driver.find_element_by_id(&#39;idSIButton9&#39;)<br># click for submit button<br>submit.click()<br>time.sleep(1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*KMx_FI_5FYjRiu3J2ToIqA.png" /></figure><p>Then, we need to fill in our password to the second form and hit to submit button.</p><pre># now we need to find password field<br>password = driver.find_element_by_id(&#39;i0118&#39;)<br># then we send our user&#39;s password <br>password.send_keys(pbi_pass)<br># after we find sign in button above<br>submit = driver.find_element_by_id(&#39;idSIButton9&#39;)<br># then we click to submit button<br>submit.click()<br>time.sleep(1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*ru88qwlP4-Asu0Ymikd8EQ.png" /></figure><p>After these prompts, there is a third screen that asks you to stay signed in, we need to hit no for this.</p><pre># to complate the login process we need to click no button from above<br># find no button by element<br>no = driver.find_element_by_id(&#39;idBtn_Back&#39;)<br># then we click to no<br>no.click()<br>time.sleep(1)</pre><p>After all these steps above, we now can navigate to our report using power bi links and grab a screenshot of our report.</p><pre>ss_path = os.path.join(current_dir, &quot;pbi_ss&quot;, ss_name)<br><br>report_url = &quot;&quot;<br><br># Navigate to the report URL<br>driver.get(report_url)<br># wait for report load<br>time.sleep(12)<br># Take a screenshot of the report and save it to a file<br>driver.save_screenshot(ss_path)</pre><p>Now we got our screenshot, we need to get rid of the unnecessary parts of it. So we find the report area of the screen with selenium and retrieve the height and width. After that, we crop the image and only the report area’s screenshot remains.</p><pre>xpath_report_area = &#39;//*[@id=&quot;pvExplorationHost&quot;]/div/div/exploration/div/explore-canvas/div/div[2]/div/div[2]/div[2]&#39;<br><br># identifying the element to capture the screenshot<br>ss = driver.find_element_by_xpath(xpath_report_area)<br># to get the element location<br>location = ss.location<br># to get the dimension the element<br>size = ss.size<br><br># to get the x axis<br>x = location[&#39;x&#39;]<br># to get the y axis<br>y = location[&#39;y&#39;]<br># to get the length the element<br>height = location[&#39;y&#39;] + size[&#39;height&#39;]<br># to get the width the element<br>width = location[&#39;x&#39;] + size[&#39;width&#39;]<br><br># to open the captured image<br>imgOpen = Image.open(ss_path)<br># to crop the captured image to size of that element<br>imgOpen = imgOpen.crop((int(x), int(y), int(width), 2000))<br>cropped_image_ss = f&quot;{ss_name}_cropped.png&quot;<br>cropped_image_path = os.path.join(current_dir, &quot;pbi_ss&quot;, cropped_image_ss)<br># to save the cropped image<br>imgOpen.save(cropped_image_path)</pre><p>With that screenshot, we can do anything that we want. We send it to a specific slack channel with custom text for our daily report checks.</p><p>Here is a full code for that operation;</p><pre>from selenium import webdriver<br>from selenium.webdriver.chrome.options import Options<br>from PIL import Image<br>import time<br><br># Set up the headless browser<br>options = Options()<br>options.headless = True<br>options.add_argument(&quot;--start-maximized&quot;)<br>driver = webdriver.Chrome(options=options)  # replace with Firefox() if using Firefox<br><br>driver.set_window_size(3840, 2160)  # optional<br><br># Log in to Power BI<br><br>driver.get(&#39;https://app.powerbi.com/?noSignUpCheck=1&#39;)<br>time.sleep(2)<br>email = driver.find_element_by_xpath(&#39;//*[@id=&quot;i0116&quot;]&#39;)<br>email.send_keys(pbi_user)<br><br>submit = driver.find_element_by_id(&#39;idSIButton9&#39;)<br>submit.click()<br>time.sleep(1)<br><br>password = driver.find_element_by_id(&#39;i0118&#39;)<br>password.send_keys(pbi_pass)<br><br>submit = driver.find_element_by_id(&#39;idSIButton9&#39;)<br>submit.click()<br>time.sleep(1)<br><br>no = driver.find_element_by_id(&#39;idBtn_Back&#39;)<br>no.click()<br>time.sleep(1)<br><br>print(&quot;Logged in successfully&quot;)<br><br>ss_path = os.path.join(current_dir, &quot;pbi_ss&quot;, ss_name)<br><br># set to powerbi report url<br>report_url = &quot;&quot;<br><br># Navigate to the report URL<br>driver.get(report_url)<br># wait for report load<br>time.sleep(12)<br># Take a screenshot of the report and save it to a file<br>driver.save_screenshot(ss_path)<br><br>xpath_report_area = &#39;//*[@id=&quot;pvExplorationHost&quot;]/div/div/exploration/div/explore-canvas/div/div[2]/div/div[2]/div[2]&#39;<br><br># identifying the element to capture the screenshot<br>ss = driver.find_element_by_xpath(xpath_report_area)<br># to get the element location<br>location = ss.location<br># to get the dimension the element<br>size = ss.size<br><br># to get the x axis<br>x = location[&#39;x&#39;]<br># to get the y axis<br>y = location[&#39;y&#39;]<br># to get the length the element<br>height = location[&#39;y&#39;] + size[&#39;height&#39;]<br># to get the width the element<br>width = location[&#39;x&#39;] + size[&#39;width&#39;]<br><br># to open the captured image<br>imgOpen = Image.open(ss_path)<br># to crop the captured image to size of that element<br>imgOpen = imgOpen.crop((int(x), int(y), int(width), 2000))<br>cropped_image_ss = f&quot;{ss_name}_cropped.png&quot;<br>cropped_image_path = os.path.join(current_dir, &quot;pbi_ss&quot;, cropped_image_ss)<br># to save the cropped image<br>imgOpen.save(cropped_image_path)<br></pre><p>Thanks for reading and for your time, you can always reach me via <a href="https://www.linkedin.com/in/furkan-yusuf-pek/">LinkedIn</a>. 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d37018f3fc2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/python-selenium-power-bi-screenshot-8d37018f3fc2">Python Selenium Power BI ScreenShot</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google BigQuery Migration: CicekSepeti Journey]]></title>
            <link>https://medium.com/cstech/google-bigquery-migration-cicek-sepeti-journey-39c3e1c669ca?source=rss-10c770be067c------2</link>
            <guid isPermaLink="false">https://medium.com/p/39c3e1c669ca</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[cloud-composer]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Furkan Yusuf Pek]]></dc:creator>
            <pubDate>Fri, 17 Jun 2022 11:24:59 GMT</pubDate>
            <atom:updated>2022-07-05T09:19:07.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*uHvyABmmUGfAlVuMpCXAjw.png" /><figcaption>Çiçek Sepeti BigQuery</figcaption></figure><p>Along with the pandemic and growing sales in the e-commerce sector, reporting and data warehousing become more important for data-driven companies. With that importance, there is also a need for a change in data warehouse architecture for growing companies.</p><p>Since the previous volume of data is not too much, traditional methods were enough for the companies. It was the same at the <a href="https://medium.com/u/6ebd550442f4">Ciceksepeti</a>.</p><p>Previously we are using the MSSQL server for our data warehousing purposes and SSIS for running tasks at a specified time. MSSQL was on a virtual server on the cloud and if the volume of the data increases, we need to increase server capacity as well. With that configuration, there are a lot of things to consider to run a data pipeline flawlessly. Server CPU, memory, and disk on the virtual machine side. Indexes, database backups, and database availability on the MSSQL server side.</p><p>Also, we were getting data from source databases via python scripts. These scripts need to be run on a server, that has lots of python dependencies and these scripts need to be maintained as well. With these python scripts, we are getting data snapshots incrementally, and loading data into staging tables. But this method has some flaws ;<br>1. There are no Change Data Capture (<a href="https://en.wikipedia.org/wiki/Change_data_capture">CDC</a>) events from the source database with that method.</p><p>2. There might be some data losses when you implement incremental load.</p><p>3. You need a trigger job to copy data from the source database with that method.</p><p>But with the recent volume of data, the architecture of the data warehouse needs to be changed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1Q_9Rpv7eDHz4PkKZ3B22w.png" /><figcaption>Google Cloud Platform</figcaption></figure><p>We selected Google BigQuery for our data warehousing solution. BigQuery is so simple and there is no need to worry about indexes, disk spaces for tables, compute powers, etc. BigQuery’s self-managed solution is exactly what we are looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Var7bXhu1HETqSJ2CxRfRA.png" /><figcaption>BigQuery Architecture</figcaption></figure><p>Our data engineering team getting data from source databases with Kafka. We have hundreds of tables and multiple source databases. Also, we have different types of data sources which are MSSQL, MySQL, and MongoDB. After a certain period of time, all these data are being sent to Google Cloud Storage, our Data Lake. This data resides in our data lake and waits to be ingested or transformed. With the help of BigQuery’s external tables, we read Google Cloud Storage data, which was sent by Kafka, and this is generating a staging layer for data ingestion. Later this data is ingested by BigQuery and generates our data warehousing tables backbone.</p><p>Kafka enables us to CDC events sink to our Cloud Storage data lake and we won’t be missing any change events from source tables. Since all events are captured by Kafka there won’t be any data losses that we previously had.</p><p>Also, the transformation part is being taken care of by BigQuery. For transformation, we are using BigQuery’s stored procedures which they called routines. We have different datasets, multiple calculations, and lots of routines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*ELeWWSGAY2a1tjP0WlhyBQ.png" /><figcaption>Apache Airflow on GCP as Cloud Composer</figcaption></figure><p>To be able to orchestrate these complex calculations and dependencies, we choose Google Cloud Composer. Google Cloud Composer is managed <a href="https://airflow.apache.org/">Airflow </a>service by Google. With the help of Airflow’s easiness and python capabilities, we replaced our existing SSIS jobs. Airflow has a nice feature that you can write your own custom operators. So we started building our in-house common operators for Airflow. An operator is a task block which is a repetitive task that needs to be done by code. With that library, we mostly wrote below repetitive tasks;</p><ul><li>Data sending through the APIs</li><li>Data sending through the STFP connections</li><li>Data getting from APIs</li><li>Data loading to different sources</li><li>Routine runs and dependencies for BigQuery</li></ul><p>Once we wrote all these things, migrating to BigQuery from the old data warehouse is accelerated.</p><p>We simply started re-writing to old data warehouse code to BigQuery standards, which is partitioning clustering etc. After that, since all prior tasks for job run and dependency architecture are ready in Airflow, we used those operators and architecture to write new Airflow dags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*KzhNwGew-wE4EeiRHGfvYQ.png" /><figcaption>Python Flask Endpoints</figcaption></figure><p>Also to ease our job of migrating old data warehouse code to BigQuery, we created some python scripted <a href="https://flask.palletsprojects.com/en/2.1.x/">flask</a> endpoints;</p><ul><li>Initial table from MSSQL to BigQuery</li><li>MSSQL to BigQuery T-SQL converter</li><li>Merge script creator for table</li><li>View creator from table columns</li></ul><p>Since we need to move data from the legacy data warehouse to BigQuery, we wrote a python code that reads data from the MSSQL server and writes it into the .parquet file chunk by chunk to avoid MSSQL server overhead. After all read operations are complete, the script uploads this parquet file to Google Cloud Storage. Then from that parquet file, the script loads the table which is specified partitioning and clustering options.</p><p>We simply copy and paste old SQL code to the T-SQL converter endpoint and this endpoint removes MSSQL-based column naming and converts the script to BigQuery standards. Also, it generates staging tables and staging view scripts.</p><p>Merge script creator, the initially loaded table’s merge script is being created by the Flask endpoint. First, the script retrieves the table’s columns with python BigQuery libraries. We have a merge template for tables and the script applies this template for all of the columns.</p><p>View script creator, the initially loaded table’s columns are retrieved via python and with the help of some template, a view script is being generated by the Flask endpoint.</p><p>All of these scripts and new technologies helped us to migrate the legacy data warehouse to the new BigQuery data warehouse. We finished most of the migration, but still, it’s an ongoing process for us.</p><p>Thanks for reading and your time, you can always reach me via <a href="https://www.linkedin.com/in/furkan-yusuf-pek/">LinkedIn</a>. 👋</p><p>For my next medium posts, I will be explaining and sharing some code blocks from our migration endpoints. Stay tuned… 😉</p><h4>References</h4><p><a href="https://en.wikipedia.org/wiki/Change_data_capture">https://en.wikipedia.org/wiki/Change_data_capture</a></p><p><a href="https://airflow.apache.org/">https://airflow.apache.org/</a></p><p><a href="https://www.confluent.io/">https://kafka.apache.org/</a></p><p><a href="https://flask.palletsprojects.com/en/2.1.x/">https://flask.palletsprojects.com/en/2.1.x/</a></p><p><a href="https://footfalldata.com/technology/google-cloud-composer-dealing-with-short-living-tasks/">https://footfalldata.com/technology/google-cloud-composer-dealing-with-short-living-tasks/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39c3e1c669ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cstech/google-bigquery-migration-cicek-sepeti-journey-39c3e1c669ca">Google BigQuery Migration: CicekSepeti Journey</a> was originally published in <a href="https://medium.com/cstech">ÇSTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>