<?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 Python SDK: &amp;quot;You have found a bug.  Replicate, then let us know.&amp;quot;` in Dev Space</title>
    <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183427#M491</link>
    <description>&lt;P&gt;I am working on putting a GUI on top of&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/12144"&gt;@Nick612Haylund&lt;/a&gt;'s Glassdoor scraper.&amp;nbsp; When I run it, I get an error that I have found a bug:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SNAG-0005.png" style="width: 707px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/38102i4A1D1FE1C9603B12/image-size/large?v=v2&amp;amp;px=999" role="button" title="SNAG-0005.png" alt="SNAG-0005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the YXI with the code.&amp;nbsp; Thoughts?&amp;nbsp; Am I missing a step in the AyxPlugin or IncomingInterface classes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jul 2018 23:29:15 GMT</pubDate>
    <dc:creator>tlarsen7572</dc:creator>
    <dc:date>2018-07-15T23:29:15Z</dc:date>
    <item>
      <title>Python SDK: "You have found a bug.  Replicate, then let us know."`</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183427#M491</link>
      <description>&lt;P&gt;I am working on putting a GUI on top of&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/12144"&gt;@Nick612Haylund&lt;/a&gt;'s Glassdoor scraper.&amp;nbsp; When I run it, I get an error that I have found a bug:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SNAG-0005.png" style="width: 707px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/38102i4A1D1FE1C9603B12/image-size/large?v=v2&amp;amp;px=999" role="button" title="SNAG-0005.png" alt="SNAG-0005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the YXI with the code.&amp;nbsp; Thoughts?&amp;nbsp; Am I missing a step in the AyxPlugin or IncomingInterface classes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 23:29:15 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183427#M491</guid>
      <dc:creator>tlarsen7572</dc:creator>
      <dc:date>2018-07-15T23:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK: "You have found a bug.  Replicate, then let us know."`</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183813#M494</link>
      <description>&lt;P&gt;Well, I definitely missed something.&amp;nbsp; I wrote a bad loop in Python that was not filling in all of the fields in the Reviews output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the original code:&lt;/P&gt;&lt;PRE&gt;    def pushReviews(self, result: ScrapeResults):
        for review in result.reviews:
            self.ReviewsCreator.reset()
            self.ReviewFields[0].set_from_string(self.ReviewsCreator, result.GlassdoorId)

            i: int = 0
            while i &amp;lt; len(result.reviews):
                self.ReviewFields[i+1].set_from_string(self.ReviewsCreator, review[i])
                i = i + 1

            self.parent.alteryx_engine.output_message(self.parent.n_tool_id, Sdk.EngineMessageType.info, str(i) + " review fields set.  Rescord outputted")
            output = self.ReviewsCreator.finalize_record()
            self.parent.Reviews.push_record(output)&lt;/PRE&gt;&lt;P&gt;and this is the working code:&lt;/P&gt;&lt;PRE&gt;    def pushReviews(self, result: ScrapeResults):
        for review in result.reviews:
            self.ReviewsCreator.reset()
            self.ReviewFields[0].set_from_string(self.ReviewsCreator, result.GlassdoorId)

            i: int = 0
            while i &amp;lt; len(review):
                self.ReviewFields[i+1].set_from_string(self.ReviewsCreator, review[i])
                i = i + 1

            output = self.ReviewsCreator.finalize_record()
            self.parent.Reviews.push_record(output)&lt;/PRE&gt;&lt;P&gt;Pretty much the same, but if you look at the while loop in the middle, you will notice a change.&amp;nbsp; This is the section that sets values in individual fields, but I was originally looping through the number of reviews rather than the number of fields in the review.&amp;nbsp; I was limiting the import to 1 page (9 reviews) and have 16 fields in the output, so the last 7 fields were not getting values.&amp;nbsp; Alteryx doesn't seem to like it when fields do not have a value and responded with the bug message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;I am attaching an updated YXI and a tester workflow for posterity.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 20:01:36 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183813#M494</guid>
      <dc:creator>tlarsen7572</dc:creator>
      <dc:date>2018-07-16T20:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK: "You have found a bug.  Replicate, then let us know."`</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183846#M495</link>
      <description>&lt;P&gt;I thought I posted a reply here...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, it turns out the bug was an error in one of my loops.&amp;nbsp; This is the method that was causing the issue; the while loop in the middle was the culprit:&lt;/P&gt;&lt;PRE&gt;def pushReviews(self, result: ScrapeResults):
	for review in result.reviews:
		self.ReviewsCreator.reset()
		self.ReviewFields[0].set_from_string(self.ReviewsCreator, result.GlassdoorId)

		i: int = 0
		while i &amp;lt; len(result.reviews):
			self.ReviewFields[i+1].set_from_string(self.ReviewsCreator, review[i])
			i = i + 1

		self.parent.alteryx_engine.output_message(self.parent.n_tool_id, Sdk.EngineMessageType.info, str(i) + " review fields set.  Rescord outputted")
		output = self.ReviewsCreator.finalize_record()
		self.parent.Reviews.push_record(output)&lt;/PRE&gt;&lt;P&gt;And this is the corrected method:&lt;/P&gt;&lt;PRE&gt;def pushReviews(self, result: ScrapeResults):
	for review in result.reviews:
		self.ReviewsCreator.reset()
		self.ReviewFields[0].set_from_string(self.ReviewsCreator, result.GlassdoorId)

		i: int = 0
		while i &amp;lt; len(review):
			self.ReviewFields[i+1].set_from_string(self.ReviewsCreator, review[i])
			i = i + 1

		output = self.ReviewsCreator.finalize_record()
		self.parent.Reviews.push_record(output)&lt;/PRE&gt;&lt;P&gt;What was happening was, rather than loop through the fields in each review, the while loop was looping through the the number of reviews.&amp;nbsp; I was limiting the number of pages to 1, so the while loop was iterating 9 times, but there are 16 fields in the Reviews output.&amp;nbsp; This means the last 7 fields were not getting a value.&amp;nbsp; Alteryx seems to dislike this and was throwing the error as a result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a YXI with corrected logic and a test workflow.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 21:17:08 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/183846#M495</guid>
      <dc:creator>tlarsen7572</dc:creator>
      <dc:date>2018-07-16T21:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK: "You have found a bug.  Replicate, then let us know."`</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/436648#M960</link>
      <description>&lt;P&gt;How did you debug the problem?&amp;nbsp; I am knocking up a tool and it does very little at moment, but I am getting this error and can get no diagnostics about what is wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:31:58 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-quot-You-have-found-a-bug-Replicate-then-let-us-know/m-p/436648#M960</guid>
      <dc:creator>Hiblet</dc:creator>
      <dc:date>2019-07-09T13:31:58Z</dc:date>
    </item>
  </channel>
</rss>

