<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help on Streaming Dataset in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2659044#M37541</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm creating Streaming datasets using python. I've created streaming dataset to stream one value which is working fine. But when I tried stream multiple values in line chart it's not working. Please help me on this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Source is - MemSQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;from datetime import datetime&lt;BR /&gt;import time&lt;BR /&gt;import psutil&lt;BR /&gt;import simplejson as json&lt;BR /&gt;import pymysql&lt;BR /&gt;import pandas as pd&lt;BR /&gt;from pathlib import Path&lt;BR /&gt;import schedule&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;directory =str(Path.home())&lt;/P&gt;&lt;P&gt;connection = pymysql.connect(user="******",&lt;BR /&gt;passwd="******",&lt;BR /&gt;host="*******",&lt;BR /&gt;port=****,&lt;BR /&gt;database="******"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;cur = connection.cursor()&lt;/P&gt;&lt;P&gt;def my_func():&lt;BR /&gt;cur.execute("select revenue,order,hour,minute from sample_table")&lt;BR /&gt;ls = []&lt;BR /&gt;for l in cur.fetchall():&lt;BR /&gt;dict_qs = {}&lt;BR /&gt;dict_qs['revenue'] = l[0]&lt;BR /&gt;dict_qs['order'] = l[1]&lt;BR /&gt;dict_qs['hour'] = l[2]&lt;BR /&gt;dict_qs['minute'] = l[3]&lt;/P&gt;&lt;P&gt;ls.append(l)&lt;BR /&gt;print(dict_qs)&lt;BR /&gt;json_data = [{&lt;BR /&gt;"Revenue": dict_qs['revenue']&lt;BR /&gt;"Order":dict_qs['order']&lt;BR /&gt;"Hour":dict_qs['hour']&lt;BR /&gt;"Minute":dict_qs['minute']&lt;BR /&gt;}]&lt;BR /&gt;res = requests.post('Power BI Streaming API', data=json.dumps(json_data))&lt;BR /&gt;print(res.status_code)&lt;/P&gt;&lt;P&gt;schedule.every(10).seconds.do(my_func)&lt;/P&gt;&lt;P&gt;while True:&lt;BR /&gt;schedule.run_pending()&lt;BR /&gt;time.sleep(5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 11:45:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-25T11:45:10Z</dc:date>
    <item>
      <title>Need help on Streaming Dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2659044#M37541</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm creating Streaming datasets using python. I've created streaming dataset to stream one value which is working fine. But when I tried stream multiple values in line chart it's not working. Please help me on this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Source is - MemSQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;from datetime import datetime&lt;BR /&gt;import time&lt;BR /&gt;import psutil&lt;BR /&gt;import simplejson as json&lt;BR /&gt;import pymysql&lt;BR /&gt;import pandas as pd&lt;BR /&gt;from pathlib import Path&lt;BR /&gt;import schedule&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;directory =str(Path.home())&lt;/P&gt;&lt;P&gt;connection = pymysql.connect(user="******",&lt;BR /&gt;passwd="******",&lt;BR /&gt;host="*******",&lt;BR /&gt;port=****,&lt;BR /&gt;database="******"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;cur = connection.cursor()&lt;/P&gt;&lt;P&gt;def my_func():&lt;BR /&gt;cur.execute("select revenue,order,hour,minute from sample_table")&lt;BR /&gt;ls = []&lt;BR /&gt;for l in cur.fetchall():&lt;BR /&gt;dict_qs = {}&lt;BR /&gt;dict_qs['revenue'] = l[0]&lt;BR /&gt;dict_qs['order'] = l[1]&lt;BR /&gt;dict_qs['hour'] = l[2]&lt;BR /&gt;dict_qs['minute'] = l[3]&lt;/P&gt;&lt;P&gt;ls.append(l)&lt;BR /&gt;print(dict_qs)&lt;BR /&gt;json_data = [{&lt;BR /&gt;"Revenue": dict_qs['revenue']&lt;BR /&gt;"Order":dict_qs['order']&lt;BR /&gt;"Hour":dict_qs['hour']&lt;BR /&gt;"Minute":dict_qs['minute']&lt;BR /&gt;}]&lt;BR /&gt;res = requests.post('Power BI Streaming API', data=json.dumps(json_data))&lt;BR /&gt;print(res.status_code)&lt;/P&gt;&lt;P&gt;schedule.every(10).seconds.do(my_func)&lt;/P&gt;&lt;P&gt;while True:&lt;BR /&gt;schedule.run_pending()&lt;BR /&gt;time.sleep(5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 11:45:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2659044#M37541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-25T11:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Streaming Dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2666620#M37576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you miss some commas in the json_data list?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchenwuzmsft_0-1658992239432.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/755651i9FEECD978DBEB61A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vchenwuzmsft_0-1658992239432.png" alt="vchenwuzmsft_0-1658992239432.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 07:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2666620#M37576</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-07-28T07:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Streaming Dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2667159#M37583</link>
      <description>&lt;P&gt;No commas are there. I forgot to add it here. but still it's not working&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 10:50:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2667159#M37583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-28T10:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Streaming Dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2668608#M37601</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the type of&amp;nbsp;&lt;STRONG&gt;dict_qs['hour']&lt;/STRONG&gt;, is it int and match the type you definded in power bi. If not, please change it via int().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 05:46:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Streaming-Dataset/m-p/2668608#M37601</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-07-29T05:46:12Z</dc:date>
    </item>
  </channel>
</rss>

