text1
stringlengths 0
536k
| text2
stringlengths 0
536k
| label
int64 0
1
|
---|---|---|
<p dir="auto">"Be happy the 520 bridge didn't get destroyed" edition</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130895835" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6864" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6864/hovercard" href="https://github.com/microsoft/TypeScript/issues/6864">#6864</a> Disallow implicitly duplicated <code class="notranslate">enum</code> values
<ul dir="auto">
<li>❌ : Highly precedented in other C-style languages</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40483812" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/471" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/471/hovercard" href="https://github.com/microsoft/TypeScript/issues/471">#471</a> Permit an implementing class to ignore private methods of the implementee class
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="x" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png">❌</g-emoji> Reconsider as a type operator</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130023716" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6758" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6758/hovercard" href="https://github.com/microsoft/TypeScript/issues/6758">#6758</a> Allow <code class="notranslate">--name=value</code> commandline switch format
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="x" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png">❌</g-emoji> Suggestion from <g-emoji class="g-emoji" alias="ghost" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f47b.png">👻</g-emoji> ?</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="136670372" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/7256" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/7256/hovercard" href="https://github.com/microsoft/TypeScript/issues/7256">#7256</a> Disallow <code class="notranslate">void</code> in truthyness positions
<ul dir="auto">
<li>👍 Very good check</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="133407645" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/7071" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/7071/hovercard" href="https://github.com/microsoft/TypeScript/issues/7071">#7071</a> <code class="notranslate">require</code> of <code class="notranslate">.json</code> file
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> Accepting PRs</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130527896" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6808" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6808/hovercard" href="https://github.com/microsoft/TypeScript/issues/6808">#6808</a> Start a deprecation path for <code class="notranslate">module</code>
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="x" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png">❌</g-emoji> TSLint is the path</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="94019726" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/3792" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/3792/hovercard" href="https://github.com/microsoft/TypeScript/issues/3792">#3792</a> Allow <code class="notranslate">export default namespace foo {</code> and other <code class="notranslate">export default</code> combos
<ul dir="auto">
<li>👍 Accepting PRs</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="137981366" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/7347" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/7347/hovercard" href="https://github.com/microsoft/TypeScript/issues/7347">#7347</a> Allow rest args in non-final positions
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="clock10" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f559.png">🕙</g-emoji> Revisit if this pattern becomes more prevalent</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="122029991" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6094" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6094/hovercard" href="https://github.com/microsoft/TypeScript/issues/6094">#6094</a> Provide a way out for incompatible derived class method signatures</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="131259712" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/6895" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/6895/hovercard" href="https://github.com/microsoft/TypeScript/issues/6895">#6895</a> Outersection types
<ul dir="auto">
<li><g-emoji class="g-emoji" alias="clock10" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f559.png">🕙</g-emoji> Revisit in context of type operators</li>
</ul>
</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="136289924" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/7234" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/7234/hovercard" href="https://github.com/microsoft/TypeScript/issues/7234">#7234</a> Constraints as inference sites
<ul dir="auto">
<li>👍 Accepting PRs or maybe we'll get to it</li>
</ul>
</li>
</ul> | <p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.7</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let firstValue = 1;
let secondValue = 2;
[firstValue, secondValue] = [3, 4];"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">firstValue</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">secondValue</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-kos">[</span><span class="pl-s1">firstValue</span><span class="pl-kos">,</span> <span class="pl-s1">secondValue</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var firstValue = 1;
var secondValue = 2;
var _a;
_a = [3, 4], firstValue = _a[0], secondValue = _a[1];"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">firstValue</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">secondValue</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_a</span><span class="pl-kos">;</span>
<span class="pl-s1">_a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">firstValue</span> <span class="pl-c1">=</span> <span class="pl-s1">_a</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">secondValue</span> <span class="pl-c1">=</span> <span class="pl-s1">_a</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Actual behavior:</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var firstValue = 1;
var secondValue = 2;
_a = [3, 4], firstValue = _a[0], secondValue = _a[1];
var _a;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">firstValue</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">secondValue</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-s1">_a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">firstValue</span> <span class="pl-c1">=</span> <span class="pl-s1">_a</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">secondValue</span> <span class="pl-c1">=</span> <span class="pl-s1">_a</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_a</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Closure Compiler reports <code class="notranslate">_a</code> as unreachable code / use before definition. While this works at runtime, it's not a good practice and looks like a bug in tsc.</p> | 0 |
<p dir="auto">I have some data that I have used to generate a stacked bar graph.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="by_conclusion = measles_data.groupby(["AGE", "CONCLUSION"])
counts_by_cause = by_conclusion.size().unstack().fillna(0)
ax = counts_by_cause.plot(kind='bar', stacked=True)"><pre class="notranslate"><code class="notranslate">by_conclusion = measles_data.groupby(["AGE", "CONCLUSION"])
counts_by_cause = by_conclusion.size().unstack().fillna(0)
ax = counts_by_cause.plot(kind='bar', stacked=True)
</code></pre></div>
<p dir="auto">However, I get a pretty crowded x-axis:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0849ca8448f46d8226f273d6168f4b6f21fa73bfecccca095b61c4a150a0cb83/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038302f32393633373938322d383639342d313165322d393662642d3234613936633365326463642e706e67"><img src="https://camo.githubusercontent.com/0849ca8448f46d8226f273d6168f4b6f21fa73bfecccca095b61c4a150a0cb83/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038302f32393633373938322d383639342d313165322d393662642d3234613936633365326463642e706e67" alt="too_many_ticks" data-canonical-src="https://f.cloud.github.com/assets/81476/229080/29637982-8694-11e2-96bd-24a96c3e2dcd.png" style="max-width: 100%;"></a></p>
<p dir="auto">So, I try to use <code class="notranslate">set_xticks</code> to try and thin them out, either as an argument to plot, or as a separate command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ax.xticks(arange(0,80,10))"><pre class="notranslate"><code class="notranslate">ax.xticks(arange(0,80,10))
</code></pre></div>
<p dir="auto">However, for some reason, the labels end up being downscaled by a factor of 10:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a07074debb63b1a01b1b4bb9f1906a4ef57a08a68514ed4c05c9706f558240f3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038312f32626536626638652d383639342d313165322d386435632d3436323838363036643738352e706e67"><img src="https://camo.githubusercontent.com/a07074debb63b1a01b1b4bb9f1906a4ef57a08a68514ed4c05c9706f558240f3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38313437362f3232393038312f32626536626638652d383639342d313165322d386435632d3436323838363036643738352e706e67" alt="wrong_ticks" data-canonical-src="https://f.cloud.github.com/assets/81476/229081/2be6bf8e-8694-11e2-8d5c-46288606d785.png" style="max-width: 100%;"></a></p>
<p dir="auto">(might be hard to see, but it is printing "0.0, 1.0, 2.0, ..." instead of "0, 10, 20, ...")</p>
<p dir="auto">Its not clear why this is happening, or how to get around it, so I'm either going about this wrong or its a bug. I get the same behavior when I try using <code class="notranslate">MaxNLocator</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ax.xaxis.set_major_locator( MaxNLocator(nbins = 7) )"><pre class="notranslate"><code class="notranslate">ax.xaxis.set_major_locator( MaxNLocator(nbins = 7) )
</code></pre></div>
<p dir="auto"><a href="https://dl.dropbox.com/u/233041/measles.csv" rel="nofollow">The data are here</a></p> | <p dir="auto">After a concat of two DataFrames with the same columns. I want to consolidate some data and remove NaNs in some columns by values in other columns. I ended up with a DataFrame that magically had additional columns.</p>
<p dir="auto">This is the minimum example that I can give to reproduce the faulty behaviour using current master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/70de129e6017c73c8903268b30f5478e4ca7bc7f/hovercard" href="https://github.com/pandas-dev/pandas/commit/70de129e6017c73c8903268b30f5478e4ca7bc7f"><tt>70de129</tt></a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df1 = pd.DataFrame([{'A':None, 'B':1},{'A':2, 'B':2}])
df2 = pd.DataFrame([{'A':3, 'B':3},{'A':4, 'B':4}])
df = pd.concat([df1, df2], axis=1)"><pre class="notranslate"><code class="notranslate">df1 = pd.DataFrame([{'A':None, 'B':1},{'A':2, 'B':2}])
df2 = pd.DataFrame([{'A':3, 'B':3},{'A':4, 'B':4}])
df = pd.concat([df1, df2], axis=1)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> df1
A B
0 NaN 1
1 2 2
[2 rows x 2 columns]
>>> df2
A B
0 3 3
1 4 4
[2 rows x 2 columns]
>>> df
A B A B
0 NaN 1 3 3
1 2 2 4 4
[2 rows x 4 columns]"><pre class="notranslate"><code class="notranslate">>>> df1
A B
0 NaN 1
1 2 2
[2 rows x 2 columns]
>>> df2
A B
0 3 3
1 4 4
[2 rows x 2 columns]
>>> df
A B A B
0 NaN 1 3 3
1 2 2 4 4
[2 rows x 4 columns]
</code></pre></div>
<p dir="auto">Now replacing NaNs in the 0 column with (corresponding) values in the 2 column ('A'), I expected to simply write a 3 into NaN (which it did), but it actually added a column '0' at the end of the DataFrame even though iloc is not supposed to enlarge the dataset. Clearly a bug.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="inds = np.isnan(df.iloc[:, 0])
df.iloc[:, 0][inds] = df.iloc[:, 2][inds]"><pre class="notranslate"><code class="notranslate">inds = np.isnan(df.iloc[:, 0])
df.iloc[:, 0][inds] = df.iloc[:, 2][inds]
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> df
A B A B 0
0 3 1 3 3 3
1 2 2 4 4 2
[2 rows x 5 columns]"><pre class="notranslate"><code class="notranslate">>>> df
A B A B 0
0 3 1 3 3 3
1 2 2 4 4 2
[2 rows x 5 columns]
</code></pre></div> | 0 |
<h3 dir="auto">What:</h3>
<p dir="auto">When a user specifies multiple chunks as output report a numeric statistic about the amount of bundle duplication across chunks.</p>
<p dir="auto">For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="*chunks*
* 124124.js ~ 10% duplication
* 213412.js ~ 50% duplication
* 545634.js ~ 25% duplication
run build -- -bundle-stats-viz to explore duplication"><pre class="notranslate"><code class="notranslate">*chunks*
* 124124.js ~ 10% duplication
* 213412.js ~ 50% duplication
* 545634.js ~ 25% duplication
run build -- -bundle-stats-viz to explore duplication
</code></pre></div>
<h3 dir="auto">Why:</h3>
<p dir="auto">When multiple chunks are output the volume of duplication is non-obvious and actually quite hard to know without using external tools. (see this post to understand the full implications <a href="http://www.susielu.com/data-viz/bundle-buddy" rel="nofollow">http://www.susielu.com/data-viz/bundle-buddy</a>) Since this "duplication" number is critical to ensuring good bundle chunk settings these values should be reported to the user so that they can better tweak their splitting process to minimize duplicaiton.</p>
<p dir="auto">Inspired by the work here<br>
<a href="https://github.com/samccone/bundle-buddy">https://github.com/samccone/bundle-buddy</a></p>
<h3 dir="auto">How:</h3>
<p dir="auto">The current approach used in bundle buddy uses source maps to build up a mapping of source lines to final bundle outputs, reusing this code should be possible if we keep using source maps as the backing data store.</p>
<p dir="auto">Thanks.</p> | <h2 dir="auto">Feature request</h2>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
There should be a function that allow entrypoint to be changed after the compiler is created, but before compilation has started.</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong><br>
See <a href="https://github.com/webpack-contrib/webpack-serve/issues/156#issuecomment-393177870" data-hovercard-type="issue" data-hovercard-url="/webpack-contrib/webpack-serve/issues/156/hovercard">this issue in webpack-serve</a>. In short, iterating entrypoints from a compiler, process, and calling <code class="notranslate">compiler.hooks.entryOption</code> with the new value does not works well with <code class="notranslate">runtimeChunk: single</code> as the old entrypoint plugin will still exists.</p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong></p>
<ul dir="auto">
<li>Plan A: Creating a registry of active entrypoint plugin instances (MultiEntryPlugin/SingleEntryPlugin/DynamicEntryPlugin), then when EntryOptionPlugin trigger again:
<ul dir="auto">
<li>A: Ask the old instance of the same entrypoint to deregister.</li>
<li>B: Recreate all instances. This allow entrypoints to be removed, but caller now has to send list of ALL entrypoints which is a breaking change.</li>
</ul>
</li>
<li>Plan B: Investigate in why RuntimeChunkPlugin does not work with duplicated entrypoints. This might resolve this issue, but could run into more issues in the future.</li>
</ul>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
If I have some guideline.</p> | 0 |
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => 3.1</li>
<li>Operating System / Platform => Windows 10 64bit and Ubuntu Linux 64bit</li>
<li>Compiler => gcc 5.3.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">The gstreamer implementation in videoio module uses CV_ERROR() on open() instead of just returning false like all other implementations. This causes an exception to be thrown, but in projects where exceptions are disabled we cannot have that - exceptions are just handled as crashes. But in this case an error can be thrown only if a file doesn't exist or if a pipeline is wrong. In our software we have a modular api that allows several pipelines in a priority order - if a pipeline cannot be used it goes to the next one. It doesn't work because the first pipeline crashes instead of returning false like the ffmpeg, dshow or any other implementation. This is clearly an inconsistency in OpenCV api.</p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" int main() {
cv::VideoCapture cap("shmsrc /tmp/socket ! video/x-raw, 1920, 1080, 1/60, format=UYVY ! videoconvert ! video/x-raw, BGR ! appsink sync=true");
}"><pre class="notranslate"> <span class="pl-k">int</span> <span class="pl-en">main</span>() {
cv::VideoCapture <span class="pl-smi">cap</span>(<span class="pl-s"><span class="pl-pds">"</span>shmsrc /tmp/socket ! video/x-raw, 1920, 1080, 1/60, format=UYVY ! videoconvert ! video/x-raw, BGR ! appsink sync=true<span class="pl-pds">"</span></span>);
}</pre></div>
<p dir="auto">That will crash if the socket doesn't exist. It would be good if it returned false if used with Open() and just set internally as not-running, so we could check with isOpened.</p> | <h3 dir="auto">Please state the information for your system</h3>
<ul dir="auto">
<li>OpenCV version: 3.1.0</li>
<li>Host OS: Linux (Ubuntu 14.04)</li>
</ul>
<h3 dir="auto">In which part of the OpenCV library you got the issue?</h3>
<p dir="auto">-videoio</p>
<h3 dir="auto">Expected behaviour</h3>
<p dir="auto">I expect ot be able to open an "OpenNI" device with gstreamer conpiled in, but no gstreamer capable devices available</p>
<h3 dir="auto">Actual behaviour</h3>
<p dir="auto">The gstreamer capture device throws a CV_ERROR when it fails to open a gstreamer device. Preventing the auto selection feature from continuing to the OpenNI open code.</p>
<h3 dir="auto">Additional description</h3>
<p dir="auto">at line 818 of cap_gstreamer.cpp (tag 3.1.0)<br>
you will find the following<br>
CV_ERROR(CV_StsError, "GStreamer: unable to start pipeline\n");<br>
This line aborts the autosearch feature of VideoCapture with a device # of 0 (first video device found)</p>
<h3 dir="auto">Code example to reproduce the issue / Steps to reproduce the issue</h3>
<p dir="auto">Please try to give a full example which will compile as is.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#include "opencv2/core.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
VideoCapture cap(0);
return 0;
}"><pre class="notranslate"><code class="notranslate">#include "opencv2/core.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
VideoCapture cap(0);
return 0;
}
</code></pre></div> | 1 |
<h2 dir="auto">Bug Report</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I would like to work on a fix!</li>
</ul>
<p dir="auto"><strong>Current Behavior</strong><br>
This bug occurrs when transpile TypeScript codes.</p>
<ol dir="auto">
<li>define a function that has function type argument with default value and rest parameters.</li>
<li>define a variable that has same name as the argument function's argument name in the function body.</li>
<li>then compile, and 'var' expression in a for sentence is disappearing from output JS codes.</li>
<li>JS runtime will throw an error like <code class="notranslate">ReferenceError: _len is not defined</code> because the assignment of a global variable is not allowed with <code class="notranslate">"use strict";</code>.</li>
<li>change the <code class="notranslate">BUGGY_ARGUMENT</code> to <code class="notranslate">DIFFERENT_ARGUMENT</code></li>
<li>works fine</li>
</ol>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const func = (
someFunc: (BUGGY_ARGUMENT: number[]) => boolean = () => false,
...restParameters: number[]
) => {
const BUGGY_ARGUMENT = someFunc(restParameters);
console.log(BUGGY_ARGUMENT);
};"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">func</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>
<span class="pl-s1">someFunc</span>: <span class="pl-kos">(</span><span class="pl-smi">BUGGY_ARGUMENT</span>: <span class="pl-smi">number</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">boolean</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-c1">false</span><span class="pl-kos">,</span>
...<span class="pl-s1">restParameters</span>: <span class="pl-smi">number</span><span class="pl-kos">[</span><span class="pl-kos">]</span>
<span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-smi">BUGGY_ARGUMENT</span> <span class="pl-c1">=</span> <span class="pl-en">someFunc</span><span class="pl-kos">(</span><span class="pl-s1">restParameters</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">BUGGY_ARGUMENT</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// output js codes
"use strict";
var func = function func() {
var someFunc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
return false;
};
return function () {
// THIS '_len' WILL THROW AN ERROR:
// `ReferenceError: _len is not defined`
for (_len = arguments.length, restParameters = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
restParameters[_key - 1] = arguments[_key];
}
var BUGGY_ARGUMENT = someFunc(restParameters);
console.log(BUGGY_ARGUMENT);
}.apply(null, arguments);
};"><pre class="notranslate"><span class="pl-c">// output js codes</span>
<span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">func</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">someFunc</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// THIS '_len' WILL THROW AN ERROR:</span>
<span class="pl-c">// `ReferenceError: _len is not defined`</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">restParameters</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span> <span class="pl-c1">></span> <span class="pl-c1">1</span> ? <span class="pl-s1">_len</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span> : <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">restParameters</span><span class="pl-kos">[</span><span class="pl-s1">_key</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-c1">BUGGY_ARGUMENT</span> <span class="pl-c1">=</span> <span class="pl-s1">someFunc</span><span class="pl-kos">(</span><span class="pl-s1">restParameters</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-c1">BUGGY_ARGUMENT</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-c1">null</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const func = (
someFunc: (DIFFERENT_ARGUMENT: number[]) => boolean = () => false,
...restParameters: number[]
) => {
const BUGGY_ARGUMENT = someFunc(restParameters);
console.log(BUGGY_ARGUMENT);
};"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">func</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>
<span class="pl-s1">someFunc</span>: <span class="pl-kos">(</span><span class="pl-smi">DIFFERENT_ARGUMENT</span>: <span class="pl-smi">number</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">boolean</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-c1">false</span><span class="pl-kos">,</span>
...<span class="pl-s1">restParameters</span>: <span class="pl-smi">number</span><span class="pl-kos">[</span><span class="pl-kos">]</span>
<span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-smi">BUGGY_ARGUMENT</span> <span class="pl-c1">=</span> <span class="pl-en">someFunc</span><span class="pl-kos">(</span><span class="pl-s1">restParameters</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">BUGGY_ARGUMENT</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
var func = function func() {
var someFunc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
return false;
};
// THIS _len WORKS FINE!!
for (var _len = arguments.length, restParameters = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
restParameters[_key - 1] = arguments[_key];
}
var BUGGY_ARGUMENT = someFunc(restParameters);
console.log(BUGGY_ARGUMENT);
};"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">func</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">func</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">someFunc</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// THIS _len WORKS FINE!!</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">restParameters</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span> <span class="pl-c1">></span> <span class="pl-c1">1</span> ? <span class="pl-s1">_len</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span> : <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">restParameters</span><span class="pl-kos">[</span><span class="pl-s1">_key</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-c1">BUGGY_ARGUMENT</span> <span class="pl-c1">=</span> <span class="pl-s1">someFunc</span><span class="pl-kos">(</span><span class="pl-s1">restParameters</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-c1">BUGGY_ARGUMENT</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)</strong></p>
<ul dir="auto">
<li>Filename: <code class="notranslate">.babelrc</code></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"presets": [
["@babel/env", {
"targets": {
"browsers": ["last 2 versions"]
}
}],
"@babel/typescript"
]
}"><pre lang=".babelrc" class="notranslate"><code class="notranslate">{
"presets": [
["@babel/env", {
"targets": {
"browsers": ["last 2 versions"]
}
}],
"@babel/typescript"
]
}
</code></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.7.7</li>
<li>Node/npm version: Node 10</li>
<li>OS: macOS 10.14.6</li>
<li>Monorepo: no</li>
<li>How you are using Babel: <code class="notranslate">cli</code></li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
Add any other context about the problem here. If applicable, add screenshots to help explain.</p>
<p dir="auto">This also occurs on online playground like the following</p>
<p dir="auto"><a href="https://babeljs.io/repl#?browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=MYewdgzgLgBAZgVzMGBeGAKAUDGEQC2ApgGJLABcmAQgKoDi9AmgPoCCASvbQLICiAOQAqVMAgIAjIgCcA2gF0AlGgB8MCSBAAbIgEMwaTMtRq4urRCIAaHDAB0D6UWgAFXdN3EoMiKPFS5eSxjNQBvW1BIWDpGVk5ufmFDfGIyZAwnV3dPIm9pCEUAbgjwfB07LRAAcwwY5nYuXkEhIqwAX2KsRHSMEJgoaQQiVqA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.7.7&externalPlugins=" rel="nofollow">https://babeljs.io/repl#?browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=MYewdgzgLgBAZgVzMGBeGAKAUDGEQC2ApgGJLABcmAQgKoDi9AmgPoCCASvbQLICiAOQAqVMAgIAjIgCcA2gF0AlGgB8MCSBAAbIgEMwaTMtRq4urRCIAaHDAB0D6UWgAFXdN3EoMiKPFS5eSxjNQBvW1BIWDpGVk5ufmFDfGIyZAwnV3dPIm9pCEUAbgjwfB07LRAAcwwY5nYuXkEhIqwAX2KsRHSMEJgoaQQiVqA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.7.7&externalPlugins=</a></p> | <h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<p dir="auto">Playground:<br>
<a href="https://babeljs.io/repl#?browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABFApgZygClJRBeRTASnwD5EBvAKEUQDcBDAJ0Qf0QEYBuGxCBNHAA2KAHRC4Ac0wMiPAL4lqtRiwAOTFHXgg07AAwKuQA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015&prettier=false&targets=&version=7.7.4&externalPlugins=" rel="nofollow">https://babeljs.io/repl#?browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABFApgZygClJRBeRTASnwD5EBvAKEUQDcBDAJ0Qf0QEYBuGxCBNHAA2KAHRC4Ac0wMiPAL4lqtRiwAOTFHXgg07AAwKuQA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015&prettier=false&targets=&version=7.7.4&externalPlugins=</a></p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function test(func = () => {
var a = 1;
console.log(a);
}) {
var previous = 0;
};"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">func</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">previous</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Translate these with es2015 presets, the result is:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
function test() {
var func = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
var a = 1;
console.log(a);
};
return function () {
previous = 0;
}();
}
;"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">func</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">previous</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">;</span></pre></div>
<p dir="auto">We can see that the generated function returns a closure, and the various <code class="notranslate">previous</code> is not declared in the closure.</p>
<p dir="auto">in strict mode, we will get the exception:<br>
<code class="notranslate">Uncaught ReferenceError: previous is not defined</code></p>
<p dir="auto"><strong>Expected behavior/code</strong><br>
The <code class="notranslate">var</code> expression won't be removed.</p>
<p dir="auto"><strong>Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)</strong></p>
<p dir="auto">Babel playground with es2015 preset config.</p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/9742995/70054907-6ac97a00-1613-11ea-9800-6b48e7a2af94.png"><img src="https://user-images.githubusercontent.com/9742995/70054907-6ac97a00-1613-11ea-9800-6b48e7a2af94.png" alt="image" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto">Hi,<br>
The following code runs without problems:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
from scipy.fftpack import rfft
rfft(np.random.random(450000))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">fftpack</span> <span class="pl-k">import</span> <span class="pl-s1">rfft</span>
<span class="pl-en">rfft</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>(<span class="pl-c1">450000</span>))</pre></div>
<p dir="auto">while this one takes forever:</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
from scipy.fftpack import rfft
rfft(np.random.random(450001))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">fftpack</span> <span class="pl-k">import</span> <span class="pl-s1">rfft</span>
<span class="pl-en">rfft</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>(<span class="pl-c1">450001</span>))</pre></div>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<p dir="auto">tested on macOS 10.14.5:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=">>> import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
1.2.1 1.16.2 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)"><pre class="notranslate"><span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">sys</span>, <span class="pl-s1">scipy</span>, <span class="pl-s1">numpy</span>; <span class="pl-en">print</span>(<span class="pl-s1">scipy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">numpy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">sys</span>.<span class="pl-s1">version_info</span>)
<span class="pl-c1">1.2</span>.<span class="pl-c1">1</span> <span class="pl-c1">1.16</span>.<span class="pl-c1">2</span> <span class="pl-s1">sys</span>.<span class="pl-en">version_info</span>(<span class="pl-s1">major</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">minor</span><span class="pl-c1">=</span><span class="pl-c1">7</span>, <span class="pl-s1">micro</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">releaselevel</span><span class="pl-c1">=</span><span class="pl-s">'final'</span>, <span class="pl-s1">serial</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)</pre></div>
<p dir="auto">and Debian 9.9:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=">>> import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
0.18.1 1.12.1 sys.version_info(major=3, minor=5, micro=3, releaselevel='final', serial=0)"><pre class="notranslate"><span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">sys</span>, <span class="pl-s1">scipy</span>, <span class="pl-s1">numpy</span>; <span class="pl-en">print</span>(<span class="pl-s1">scipy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">numpy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">sys</span>.<span class="pl-s1">version_info</span>)
<span class="pl-c1">0.18</span>.<span class="pl-c1">1</span> <span class="pl-c1">1.12</span>.<span class="pl-c1">1</span> <span class="pl-s1">sys</span>.<span class="pl-en">version_info</span>(<span class="pl-s1">major</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">minor</span><span class="pl-c1">=</span><span class="pl-c1">5</span>, <span class="pl-s1">micro</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">releaselevel</span><span class="pl-c1">=</span><span class="pl-s">'final'</span>, <span class="pl-s1">serial</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)</pre></div> | <p dir="auto">FFT on len 262144 = 20m/s<br>
FFT on len 257144 = 8000m/s</p>
<p dir="auto">It actually seems quite erratic. Some will only take say 60m/s, others several hundred and if you go for an odd number I normally end up killing it after a few minutes</p> | 1 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [13]: s = Series(np.arange(10))
In [14]: np.diff(s)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/wesm/code/pandas/<ipython-input-14-b5f9fe77ab7c> in <module>()
----> 1 np.diff(s)
/usr/lib/epd-7.1/lib/python2.7/site-packages/numpy/lib/function_base.pyc in diff(a, n, axis)
975 return diff(a[slice1]-a[slice2], n-1, axis=axis)
976 else:
--> 977 return a[slice1]-a[slice2]
978
979 def interp(x, xp, fp, left=None, right=None):
/home/wesm/code/pandas/pandas/core/series.pyc in __getitem__(self, key)
392 key = np.asarray(key, dtype=bool)
393
--> 394 return self._get_with(key)
395
396 def _get_with(self, key):
/home/wesm/code/pandas/pandas/core/series.pyc in _get_with(self, key)
406 else:
407 if isinstance(key, tuple):
--> 408 return self._get_values_tuple(key)
409
410 if not isinstance(key, (list, np.ndarray)): # pragma: no cover
/home/wesm/code/pandas/pandas/core/series.pyc in _get_values_tuple(self, key)
437
438 if not isinstance(self.index, MultiIndex):
--> 439 raise ValueError('Can only tuple-index with a MultiIndex')
440
441 # If key is contained, would have returned by now
ValueError: Can only tuple-index with a MultiIndex"><pre class="notranslate"><code class="notranslate">In [13]: s = Series(np.arange(10))
In [14]: np.diff(s)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/wesm/code/pandas/<ipython-input-14-b5f9fe77ab7c> in <module>()
----> 1 np.diff(s)
/usr/lib/epd-7.1/lib/python2.7/site-packages/numpy/lib/function_base.pyc in diff(a, n, axis)
975 return diff(a[slice1]-a[slice2], n-1, axis=axis)
976 else:
--> 977 return a[slice1]-a[slice2]
978
979 def interp(x, xp, fp, left=None, right=None):
/home/wesm/code/pandas/pandas/core/series.pyc in __getitem__(self, key)
392 key = np.asarray(key, dtype=bool)
393
--> 394 return self._get_with(key)
395
396 def _get_with(self, key):
/home/wesm/code/pandas/pandas/core/series.pyc in _get_with(self, key)
406 else:
407 if isinstance(key, tuple):
--> 408 return self._get_values_tuple(key)
409
410 if not isinstance(key, (list, np.ndarray)): # pragma: no cover
/home/wesm/code/pandas/pandas/core/series.pyc in _get_values_tuple(self, key)
437
438 if not isinstance(self.index, MultiIndex):
--> 439 raise ValueError('Can only tuple-index with a MultiIndex')
440
441 # If key is contained, would have returned by now
ValueError: Can only tuple-index with a MultiIndex
</code></pre></div> | <p dir="auto">In trying to find out the fast way to count unique rows in a data frame, I <a href="https://gist.github.com/jreback/9758917f02d5c2140b82c9c368b02d3b">stumbled upon an issue</a> where dropping duplicates from a data frame of booleans is quite slow. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jreback/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jreback">@jreback</a> asked me to open a ticket.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: N = 100000
In [4]: np.random.seed(1234)
In [5]: df = pd.DataFrame({str(i) : [bool(x) for x in np.random.randint(0,2,size=N)] for i in range(500)})
In [6]: %timeit df.drop_duplicates()
1 loop, best of 3: 3.01 s per loop
In [7]: %timeit df.astype(int).drop_duplicates()
1 loop, best of 3: 1.4 s per loop"><pre class="notranslate"><code class="notranslate">In [1]: import pandas as pd
In [2]: import numpy as np
In [3]: N = 100000
In [4]: np.random.seed(1234)
In [5]: df = pd.DataFrame({str(i) : [bool(x) for x in np.random.randint(0,2,size=N)] for i in range(500)})
In [6]: %timeit df.drop_duplicates()
1 loop, best of 3: 3.01 s per loop
In [7]: %timeit df.astype(int).drop_duplicates()
1 loop, best of 3: 1.4 s per loop
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.1.2
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0"><pre class="notranslate"><code class="notranslate">INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.1.2
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
</code></pre></div> | 0 |
<p dir="auto"><strong>Which version of ShardingSphere did you use?</strong><br>
5.0.0-alpha<br>
<strong>Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</strong><br>
ShardingSphere-JDBC<br>
<strong>Expected behavior</strong><br>
Correct paging<br>
<strong>Actual behavior</strong><br>
Wrong pagination, except for the first page<br>
<strong>Reason analyze</strong><br>
When I use a paged query,It seems that the rewrite engine did not rewrite the paging parameters.<br>
<strong>Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</strong><br>
Environment: shardingsphere-jdbc-core 5.0.0-alpha sharding configuration with JavaAPI,SpringBoot v2.1.5.RELEASE,Oracle 11g,JPA<br>
Only one table slice is configured,the rule is: inline,TABLENAME_${KEY}.<br>
One physical table has two records, and two other physical tables have one record, and the rest have no records.<br>
When the third page is queried with pagesize 1, it will not be found.<br>
My code is: <code class="notranslate">entityManager.createQuery(cq).setFirstResult(2).setMaxResults(1).getResultList();</code><br>
Logic SQL: .<code class="notranslate">..) row_ where rownum <= ?) where rownum_ > ? ::: [3, 2]</code><br>
Actual SQL: <code class="notranslate">...) row_ where rownum <= ?) where rownum_ > ? ::: [3, 2]</code></p> | <p dir="auto">Hi, we are glad you can fix this issue to become a contributor to Apache Sharding Sphere.<br>
Welcome! <g-emoji class="g-emoji" alias="smiley" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f603.png">😃</g-emoji></p>
<p dir="auto">By doing this assignment, you can learn more about how a query SQL is parsed and how to verify the parsing result of a SQL in Apache ShardingSphere.</p>
<p dir="auto"><strong>This issue is to</strong> add the parsing assertion for <code class="notranslate">ComplexExpressionSegment </code> by adding the <code class="notranslate">start-index</code> and <code class="notranslate">stop-index</code> attributes in <code class="notranslate">parsing-result.xml</code>.</p>
<p dir="auto">It is not difficult, and the following comment also gives you the detailed instruction. BTW, if you need any help, please be free to reply to this one.</p> | 0 |
<p dir="auto">Both rule and cost query planners implement</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH n
WHERE n:Male
RETURN n"><pre class="notranslate"><code class="notranslate">MATCH n
WHERE n:Male
RETURN n
</code></pre></div>
<p dir="auto">with a <code class="notranslate">NodeByLabelScan</code> and not with an <code class="notranslate">AllNodesScan</code> plus a filter on the label. I therefore would expect</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH n
WHERE n:Male OR n:Female
RETURN n"><pre class="notranslate"><code class="notranslate">MATCH n
WHERE n:Male OR n:Female
RETURN n
</code></pre></div>
<p dir="auto">to be implemented with two <code class="notranslate">NodeByLabelScan</code>'s. Instead both planners use an <code class="notranslate">AllNodesScan</code> and then a filter.</p>
<p dir="auto">For a simple label disjunction like this, would it not be possible and prudent for the planners to implement the query with label scans?</p>
<p dir="auto">Related <a href="http://stackoverflow.com/questions/20003769/neo4j-match-multiple-labels-2-or-more" rel="nofollow">SO question</a>.</p> | <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gokcemutlu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gokcemutlu">@gokcemutlu</a>: 'Hi,</p>
<p dir="auto">I have a simple model:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="START root=node(0) CREATE UNIQUE root-[:PEOPLE]->(jake {Name:'Jake'}), root-[:PEOPLE]->(jill {Name:'Jill'}), jake-[:LIKE]->jill, jill-[:LIKE]->jake, jake-[:LIKE]->jake;"><pre class="notranslate"><code class="notranslate">START root=node(0) CREATE UNIQUE root-[:PEOPLE]->(jake {Name:'Jake'}), root-[:PEOPLE]->(jill {Name:'Jill'}), jake-[:LIKE]->jill, jill-[:LIKE]->jake, jake-[:LIKE]->jake;
</code></pre></div>
<p dir="auto">In this model</p>
<ul dir="auto">
<li>Jake likes Jill,</li>
<li>Jill likes Jake</li>
<li>Jake likes Jake</li>
</ul>
<p dir="auto">I want to find out Jake likes who.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="START r = node(0) MATCH r-[:PEOPLE]->jake, path=(jake-[:LIKE]->person-[:LIKE]->jake) where jake.Name = 'Jake' RETURN person;"><pre class="notranslate"><code class="notranslate">START r = node(0) MATCH r-[:PEOPLE]->jake, path=(jake-[:LIKE]->person-[:LIKE]->jake) where jake.Name = 'Jake' RETURN person;
</code></pre></div>
<p dir="auto">This query returns only Jill and this is wrong.</p>
<p dir="auto">Please let me know.</p>
<p dir="auto">Regards,<br>
Gokce'</p> | 0 |
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
Chunks generated by <code class="notranslate">System.import</code> or <code class="notranslate">import</code> do not affected by CommonsChunkPlugin.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
<a href="https://github.com/rzcoder/webpack_chunks_issue">demo rep</a></p>
<p dir="auto"><em>sources structure</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src
|- modules
| |- module0.js
| |- module1.js
|- index.js"><pre class="notranslate"><code class="notranslate">src
|- modules
| |- module0.js
| |- module1.js
|- index.js
</code></pre></div>
<p dir="auto"><em>webpack.config.js</em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const path = require('path');
const webpack = require("webpack");
module.exports = {
entry: {
index: './src/index.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: 'dist/'
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "vendors",
minChunks: function(module) {
return module.resource && (/node_modules/).test(module.resource);
}
})
]
};
"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">webpack</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"webpack"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">entry</span>: <span class="pl-kos">{</span>
<span class="pl-c1">index</span>: <span class="pl-s">'./src/index.js'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">output</span>: <span class="pl-kos">{</span>
<span class="pl-c1">filename</span>: <span class="pl-s">'[name].js'</span><span class="pl-kos">,</span>
<span class="pl-c1">path</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'dist'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">publicPath</span>: <span class="pl-s">'dist/'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">CommonsChunkPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">"vendors"</span><span class="pl-kos">,</span>
<span class="pl-en">minChunks</span>: <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-c1">resource</span> <span class="pl-c1">&&</span> <span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-c1">resource</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><em>index.js</em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="for (let i = 0; i < 2; i++) {
System.import("./modules/module" + i).then((module) => module.default());
}"><pre class="notranslate"><span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-c1">2</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-v">System</span><span class="pl-kos">.</span><span class="pl-en">import</span><span class="pl-kos">(</span><span class="pl-s">"./modules/module"</span> <span class="pl-c1">+</span> <span class="pl-s1">i</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-en">default</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><em>modules/module0.js</em> && <em>modules/module1.js</em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as _ from "lodash";
export default () => console.log(_.random(100));"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">_</span> <span class="pl-k">from</span> <span class="pl-s">"lodash"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">_</span><span class="pl-kos">.</span><span class="pl-en">random</span><span class="pl-kos">(</span><span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Generated chunks for module0 & module1 both has copy of <code class="notranslate">lodash</code> and vendors.js is empty.</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Dynamically generated chunks must be affected by CommonsChunkPlugin in same way as entry points.</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
node 7.0.0, webpack 2.2.1, OSX</p> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Feature for <code class="notranslate">CommonChunkPlugin</code>.</p>
<p dir="auto">Support selecting modules from <strong>non-entry</strong> chunks. Meaning, select statically imported modules from chunks that were created from a <strong>dynamic</strong> import (<code class="notranslate">require.ensure</code> / <code class="notranslate">System.import</code> / <code class="notranslate">import("..")</code>)</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Currently <code class="notranslate">CommonChunkPlugin</code> only receives modules imported from <strong>entry</strong> chunks.</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto"><code class="notranslate">CommonChunkPlugin</code> should receive also modules from <strong>non-entry</strong> chunks.<br><br>
Another option will be that the default behavior will be that the plugin won't be getting these modules and only with passing something like <code class="notranslate">selectAllChunks: true</code> will enable this behavior.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto">Most of the examples out there talks about CodeSplitting but not talking about CodeSplitting with lazy loading. For example, load your main page as an entry chunk, and split the rest of your website routes to different chunks and only load those on demand.</p>
<p dir="auto">You see the important need for this feature when you're trying to make a <code class="notranslate">vendors</code> chunk that will include the vendors from ALL the chunks including the ones for the different routes that are being created from a dynamic import as a split point.</p>
<p dir="auto">In our opinion the best solution to create the <code class="notranslate">vendors</code> chunk will be using the <code class="notranslate">minChunks</code> function since the other two (specifying hard coded which packages to take / import <code class="notranslate">package.json</code>.dependencies) has a lot of issues with and this is the most dynamic way to do it:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
minChunks: ({ resource }) => /node_modules/.test(resource)
})"><pre class="notranslate"> <span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">CommonsChunkPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'vendors'</span><span class="pl-kos">,</span>
<span class="pl-en">minChunks</span>: <span class="pl-kos">(</span><span class="pl-kos">{</span> resource <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">resource</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">The problem is that since <code class="notranslate">CommonsChunkPlugin</code> only gets modules form the <strong>entry</strong> chunks, so all the vendors from our different split points are not being added to this chunk.</p>
<p dir="auto">The motivation around this feature request is that others won't need to do the workaround I'll show here.</p>
<p dir="auto"><strong>Proposed temporary workaround and why it's not that good. Writing it here anyway so who ever needs it will see it and would be able to use it</strong></p>
<p dir="auto">What the lack of this feature forces us to do it for every dynamic import we're doing (using <code class="notranslate">import("path")</code>) we're also going and creating an entry chunk for it. Just so the above code will work.</p>
<p dir="auto">Then, all of these "duplicate" chunks we're excluding from being added to the HTML using the <code class="notranslate">excludeChunks</code> of <code class="notranslate">HtmlWebpackPlugin</code></p>
<p dir="auto">So it basically looks like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
// Why do we need to exclude these entries?
// The entries here are being dynamically loaded per route in the application so we would like to set
// them to be excluded form HtmlWebpackPlugin auto inject of entry chunks.
//
// If they are being dynamically loaded in the system, so why do you need them here at all?
// We're creating a `vendors` chunk automatically from what being imported from `node_modules`, in order for webpack
// to know about what code exists in these route chunks we need to set them as entries here.
// That way we're getting everything we ever wanted! The `vendors` is being created out of ALL the vendors in the system,
// and we're still able to dynamically load these chunks per route without having them injected to index.html at the beginning.
const excludeEntries = {
main: [path.join(chunksPath, 'main_chunk')],
A_template_collection: [path.join(pagesPath, 'TemplateCollectionPage')],
A_template_wizard: [path.join(pagesPath, 'TemplateWizardPage')],
A_edit_template: [path.join(pagesPath, 'TemplateEditPage')],
A_create_instance: [path.join(pagesPath, 'CreateInstancePage')],
B_issues_collection: [path.join(pagesPath, 'IssuesCollectionPage')]
};
const entry = Object.assign({}, excludeEntries, {
application: [path.join(chunksPath, 'application_chunk')]
});
const config = {
entry,
...
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
minChunks: ({ resource }) => /node_modules/.test(resource)
}),
new HtmlWebpackPlugin({
title: indexHtmlTitle,
resourceHintsMetaTags,
inject: true,
template: indexHtmlPath,
excludeChunks: Object.keys(excludeEntries)
}),
]
...
}
"><pre class="notranslate">...
<span class="pl-c">// Why do we need to exclude these entries?</span>
<span class="pl-c">// The entries here are being dynamically loaded per route in the application so we would like to set</span>
<span class="pl-c">// them to be excluded form HtmlWebpackPlugin auto inject of entry chunks.</span>
<span class="pl-c">//</span>
<span class="pl-c">// If they are being dynamically loaded in the system, so why do you need them here at all?</span>
<span class="pl-c">// We're creating a `vendors` chunk automatically from what being imported from `node_modules`, in order for webpack</span>
<span class="pl-c">// to know about what code exists in these route chunks we need to set them as entries here.</span>
<span class="pl-c">// That way we're getting everything we ever wanted! The `vendors` is being created out of ALL the vendors in the system,</span>
<span class="pl-c">// and we're still able to dynamically load these chunks per route without having them injected to index.html at the beginning.</span>
<span class="pl-k">const</span> <span class="pl-s1">excludeEntries</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">main</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">chunksPath</span><span class="pl-kos">,</span> <span class="pl-s">'main_chunk'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">A_template_collection</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">pagesPath</span><span class="pl-kos">,</span> <span class="pl-s">'TemplateCollectionPage'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">A_template_wizard</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">pagesPath</span><span class="pl-kos">,</span> <span class="pl-s">'TemplateWizardPage'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">A_edit_template</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">pagesPath</span><span class="pl-kos">,</span> <span class="pl-s">'TemplateEditPage'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">A_create_instance</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">pagesPath</span><span class="pl-kos">,</span> <span class="pl-s">'CreateInstancePage'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">B_issues_collection</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">pagesPath</span><span class="pl-kos">,</span> <span class="pl-s">'IssuesCollectionPage'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">entry</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">excludeEntries</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">application</span>: <span class="pl-kos">[</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">chunksPath</span><span class="pl-kos">,</span> <span class="pl-s">'application_chunk'</span><span class="pl-kos">)</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">config</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-s1">entry</span><span class="pl-kos">,</span>
...
<span class="pl-s1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">CommonsChunkPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'vendors'</span><span class="pl-kos">,</span>
<span class="pl-en">minChunks</span>: <span class="pl-kos">(</span><span class="pl-kos">{</span> resource <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">resource</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-k">new</span> <span class="pl-v">HtmlWebpackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">title</span>: <span class="pl-s1">indexHtmlTitle</span><span class="pl-kos">,</span>
resourceHintsMetaTags<span class="pl-kos">,</span>
<span class="pl-c1">inject</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">template</span>: <span class="pl-s1">indexHtmlPath</span><span class="pl-kos">,</span>
<span class="pl-c1">excludeChunks</span>: <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">excludeEntries</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span>
...
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The dynamic imports are being used on the same paths as the entry chunks that are being excluded from the html.</p>
<p dir="auto">This causes some difficulties for us:</p>
<ol dir="auto">
<li>If you dynamically import something and forget to put it here as well it will not go into the vendors chunks and you'll lose cache</li>
<li>This creates for us chunks that we're not actually using. So for the same code I'll have the named entry chunk and I'll also have a chunk from the dynamic import. I'm not using the named entry-chunks but it's just noise to me.<br>
That is even bigger when also using the ExtractTextPlugin.</li>
</ol>
<p dir="auto">I looked also here: <a href="https://github.com/oieduardorabelo/webpack-commonschunkplugin-dynamic-splitting">https://github.com/oieduardorabelo/webpack-commonschunkplugin-dynamic-splitting</a><br>
But that seems to not be related since in our case the only real entry point (<code class="notranslate">application: [path.join(chunksPath, 'application_chunk')]</code>) is basically just loading polyfills + loading the <code class="notranslate">main</code> chunk path dynamically. Since all the <code class="notranslate">application</code> chunk is doing is mainly dynamically <code class="notranslate">import()</code> stuff it has no static imports of files from <code class="notranslate">node_modules</code>. So CommonChunkPlugin doesn't catch that..</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p>
<ul dir="auto">
<li>OS: macOS 10.12.3</li>
<li>Node.js version: 6.9.10</li>
<li>Webpack version: 2.2.1</li>
<li>Browser not relavant</li>
</ul> | 1 |
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one): BUG REPORT</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.5", GitCommit:"b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5", GitTreeState:"clean", BuildDate:"2016-08-11T20:29:08Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0", GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94", GitTreeState:"clean", BuildDate:"2016-07-01T19:19:19Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}"><pre class="notranslate"><code class="notranslate">Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.5", GitCommit:"b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5", GitTreeState:"clean", BuildDate:"2016-08-11T20:29:08Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0", GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94", GitTreeState:"clean", BuildDate:"2016-07-01T19:19:19Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
</code></pre></div>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: AWS</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): The one created by <code class="notranslate">kube-up.sh</code></li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): The one used by <code class="notranslate">kube-up.sh</code></li>
<li><strong>Install tools</strong>: kube-up.sh</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubectl --kubeconfig=infra/dev/kubeconfig drain --ignore-daemonsets --force --delete-local-data --grace-period=120 ip-172-20-0-123.ec2.internal
node "ip-172-20-0-123.ec2.internal" already cordoned
error: replicationcontrollers "memcached" not found: memcached-4n9cy, memcached-4n9cy"><pre class="notranslate"><code class="notranslate">kubectl --kubeconfig=infra/dev/kubeconfig drain --ignore-daemonsets --force --delete-local-data --grace-period=120 ip-172-20-0-123.ec2.internal
node "ip-172-20-0-123.ec2.internal" already cordoned
error: replicationcontrollers "memcached" not found: memcached-4n9cy, memcached-4n9cy
</code></pre></div>
<p dir="auto">It would seem that <code class="notranslate">memcached-4n9cy</code> is an orphan pod from a replication controller that doesn't exist anymore.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./kubectl --kubeconfig=infra/dev/kubeconfig describe pod memcached-4n9cy | grep Controllers
Controllers: ReplicationController/memcached"><pre class="notranslate"><code class="notranslate">$ ./kubectl --kubeconfig=infra/dev/kubeconfig describe pod memcached-4n9cy | grep Controllers
Controllers: ReplicationController/memcached
</code></pre></div>
<p dir="auto">We moved to ReplicaSets and don't have any ReplicationControllers left:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./kubectl --kubeconfig=infra/dev/kubeconfig get --all-namespaces rc
NAMESPACE NAME DESIRED CURRENT AGE
kube-system kube-dns-v17 1 1 41d
kube-system kubernetes-dashboard-v1.1.0 1 1 41d
kube-system monitoring-influxdb-grafana-v3 1 1 41d"><pre class="notranslate"><code class="notranslate">$ ./kubectl --kubeconfig=infra/dev/kubeconfig get --all-namespaces rc
NAMESPACE NAME DESIRED CURRENT AGE
kube-system kube-dns-v17 1 1 41d
kube-system kubernetes-dashboard-v1.1.0 1 1 41d
kube-system monitoring-influxdb-grafana-v3 1 1 41d
</code></pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">Providing <code class="notranslate">--force</code> should allow you to drain the pods even if they are orphans from a replication controller.</p>
<p dir="auto">I had to manually remove the pod before running <code class="notranslate">kubectl drain</code> again to make it work.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<p dir="auto">I am not sure how the pods ended up being orphaned but I guess that getting an orphaned pod from a replication controller should make it easy to reproduce.</p>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p> | <p dir="auto">We had a micro-outage the other day when one of the machines in our cluster stopped trying to restart. On startup, it hit a transient error that prevented the server from starting up, but the pod did not try to restart again after that. The logs showed nothing between when it got stuck starting up and when I initiated a manual restart 20 minutes later. It seems we hit this issue during a network partition, though we are still investigating.</p>
<p dir="auto">Does the pod need to talk to the master in order for a restart to be triggered?</p>
<p dir="auto">Attached is our configuration file, including the restart policy <a href="https://github.com/kubernetes/kubernetes/files/192511/apiserverProdConfig.txt">apiserverProdConfig.txt</a></p>
<p dir="auto">Thanks!</p>
<p dir="auto">We're using Kubernetes 1.2.0</p> | 0 |
<p dir="auto"><a href="https://github.com/microsoft/PowerToys/files/5012670/2020-08-02.txt">2020-08-02.txt</a></p>
<p dir="auto">PowerToys: 0.20</p>
<p dir="auto">Version: 1.0.0<br>
OS Version: Microsoft Windows NT 10.0.19041.0<br>
IntPtr Length: 8<br>
x64: True<br>
Date: 08/02/2020 20:58:46<br>
Exception:<br>
System.ObjectDisposedException: Cannot access a disposed object.<br>
Object name: 'Timer'.<br>
at System.Timers.Timer.set_Enabled(Boolean value)<br>
at System.Timers.Timer.Start()<br>
at PowerLauncher.MainWindow.OnVisibilityChanged(Object sender, DependencyPropertyChangedEventArgs e)<br>
at System.Windows.UIElement.RaiseDependencyPropertyChanged(EventPrivateKey key, DependencyPropertyChangedEventArgs args)<br>
at System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)<br>
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br>
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br>
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)<br>
at System.Windows.UIElement.UpdateIsVisibleCache()<br>
at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot)<br>
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)<br>
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)<br>
at System.Windows.Window.SetRootVisual()<br>
at System.Windows.Window.SetRootVisualAndUpdateSTC()<br>
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)<br>
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)<br>
at System.Windows.Window.CreateSourceWindowDuringShow()<br>
at System.Windows.Window.SafeCreateWindowDuringShow()<br>
at System.Windows.Window.ShowHelper(Object booleanBox)<br>
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)<br>
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)</p> | <p dir="auto">Popup tells me to give y'all this.</p>
<p dir="auto"><a href="https://github.com/microsoft/PowerToys/files/5009460/2020-07-31.txt">2020-07-31.txt</a></p>
<p dir="auto">Version: 1.0.0<br>
OS Version: Microsoft Windows NT 10.0.19041.0<br>
IntPtr Length: 8<br>
x64: True<br>
Date: 07/31/2020 17:29:59<br>
Exception:<br>
System.ObjectDisposedException: Cannot access a disposed object.<br>
Object name: 'Timer'.<br>
at System.Timers.Timer.set_Enabled(Boolean value)<br>
at System.Timers.Timer.Start()<br>
at PowerLauncher.MainWindow.OnVisibilityChanged(Object sender, DependencyPropertyChangedEventArgs e)<br>
at System.Windows.UIElement.RaiseDependencyPropertyChanged(EventPrivateKey key, DependencyPropertyChangedEventArgs args)<br>
at System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)<br>
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br>
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)<br>
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)<br>
at System.Windows.UIElement.UpdateIsVisibleCache()<br>
at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot)<br>
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)<br>
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)<br>
at System.Windows.Window.SetRootVisual()<br>
at System.Windows.Window.SetRootVisualAndUpdateSTC()<br>
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)<br>
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)<br>
at System.Windows.Window.CreateSourceWindowDuringShow()<br>
at System.Windows.Window.SafeCreateWindowDuringShow()<br>
at System.Windows.Window.ShowHelper(Object booleanBox)<br>
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)<br>
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)</p> | 1 |
<p dir="auto">An overflowing fp -> int cast, for example:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[inline(never)]
fn show<T: std::fmt::Debug>(e: T) { println!("{:?}", e) }
fn main() {
show({
9.223372036854776e18f64 as i64
});
}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>inline<span class="pl-kos">(</span>never<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">show</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span> std<span class="pl-kos">::</span>fmt<span class="pl-kos">::</span><span class="pl-smi">Debug</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">:</span> <span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{:?}"</span>, e<span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">show</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">9.223372036854776e18f64</span> <span class="pl-k">as</span> <span class="pl-smi">i64</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><a href="http://is.gd/0sDILD" rel="nofollow">playpen</a></p>
<p dir="auto">Causes LLVM to not initialise the parameter passed to <code class="notranslate">show</code>:</p>
<div class="highlight highlight-source-llvm notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trs: uwtable
define internal void @_ZN4main20he0a80c27bce3fc14RaaE() unnamed_addr #0 {
entry-block:
tail call fastcc void @_ZN4show21h11375292364260386722E()
ret void
}"><pre class="notranslate">trs: <span class="pl-k">uwtable</span>
<span class="pl-k">define</span> <span class="pl-k">internal</span> <span class="pl-k">void</span> <span class="pl-c1">@_ZN4main20he0a80c27bce3fc14RaaE</span>() <span class="pl-k">unnamed_addr</span> #<span class="pl-c1">0</span> {
entry-block:
<span class="pl-k">tail</span> <span class="pl-k">call</span> <span class="pl-k">fastcc</span> <span class="pl-k">void</span> <span class="pl-c1">@_ZN4show21h11375292364260386722E</span>()
<span class="pl-k">ret</span> <span class="pl-k">void</span>
}</pre></div> | <blockquote>
<p dir="auto">If the value cannot fit within the destination type, ty2, then the results are undefined.</p>
</blockquote>
<p dir="auto"><a href="http://llvm.org/docs/LangRef.html#fptrunc-to-instruction" rel="nofollow">http://llvm.org/docs/LangRef.html#fptrunc-to-instruction</a></p>
<p dir="auto">e.g. <code class="notranslate">1e300f64 as f32</code></p>
<p dir="auto">cc <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="21869137" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/10184" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/10184/hovercard" href="https://github.com/rust-lang/rust/issues/10184">#10184</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="21869206" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/10185" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/10185/hovercard" href="https://github.com/rust-lang/rust/issues/10185">#10185</a></p> | 1 |
<p dir="auto">Hello. I was trying to build julia in Scientific Linux SL release 5.5 and got something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" JULIA usr/lib/julia/sys.ji
error during bootstrap: assign array[5]: index out of range
make[1]: *** [/imports/home/s/shhong/src/julia/usr/lib/julia/sys.ji] Error 1
make: *** [debug] Error 2"><pre class="notranslate"><code class="notranslate"> JULIA usr/lib/julia/sys.ji
error during bootstrap: assign array[5]: index out of range
make[1]: *** [/imports/home/s/shhong/src/julia/usr/lib/julia/sys.ji] Error 1
make: *** [debug] Error 2
</code></pre></div>
<p dir="auto">Any idea? Also, in Julia how am I supposed to probe what is wrong in the case like this?</p> | <p dir="auto">I'm seeing an error on bootstrap but in a different location:</p>
<p dir="auto">CC src/sys.o<br>
CC src/init.o<br>
CC src/task.o<br>
CC src/array.o<br>
CC src/dump.o<br>
CC src/toplevel.o<br>
CC src/gc.o<br>
LINK usr/lib/libjulia-release.so<br>
PERL base/pcre_h.jl<br>
PERL base/errno_h.jl<br>
PERL base/os_detect.jl<br>
PERL extras/glpk_h.jl<br>
PERL extras/julia_message_types_h.jl<br>
CC ui/repl.o<br>
CC ui/repl-basic.o<br>
LINK usr/bin/julia-release-basic<br>
CC ui/repl-readline.o</p>
<p dir="auto">repl-readline.c: In function âinit_historyâ:<br>
repl-readline.c:73: warning: implicit declaration of function âstpcpyâ<br>
repl-readline.c:73: warning: incompatible implicit declaration of built-in function âstpcpyâ<br>
LINK usr/bin/julia-release-readline<br>
LINK usr/bin/julia-release-webserver<br>
JULIA usr/lib/julia/sys.ji<br>
could not show value of type ErrorException<br>
error during bootstrap: syntax error: error expanding macro _jl_sort_functions at sort.jl:189</p>
<p dir="auto">make[1]: *** [/n/home00/pedmon/test/julia/usr/lib/julia/sys.ji] Error 1<br>
make: *** [release] Error 2</p>
<p dir="auto">This is building on RedHat 5.1, but I also get it on CentOS 6.2</p> | 1 |
<p dir="auto">hello, everyone.<br>
i have a problem that the images are misplaced when the gridview is scrolling fast.<br>
i just use glide in getView() like this:<br>
Glide.with().load().asBitmap().thumbnail().into();</p> | <p dir="auto">I have a ListView for which each row contain one ImageView + TextViews.<br>
Something very usual and unspectacular.</p>
<p dir="auto">The first row's Imagaeview holds an animated GIF while all other rows hold regular JPG images.</p>
<p dir="auto">On my Nexus4, somerhing funny is going on. Scrolling it the list, towards the 7th or 8th row (which are just offscreen) , a random unnanimated frame of the first GIF is displayed instead of the JPG image that should display for this row.<br>
Sometimes these are several consecutive rows (possibly 5 or 6) that display a random frame of the animated GIF.<br>
If I scroll enough in the list, all get back to normal as the GIF is evicted from the cache (guess).</p>
<p dir="auto">It goes like this:</p>
<p dir="auto">row 1: animated GIF plays fine and is correct for this row<br>
row 2: JPG OK<br>
...<br>
row 7: JPG OK<br>
row 8: displays still frame of row 1 GIF instead of correct JPG for this row<br>
row 9: displays still frame of row 1 GIF instead of correct JPG for this row<br>
row 10: JPG OK<br>
...</p>
<p dir="auto">This bug happens on my Nexus 4 running 4.4.4 but not my Nexus 5.</p>
<p dir="auto">Looking at the logcat, there's something interesting.<br>
Each time a row displays a frame of the animated GIF instead of the image it should, the logcat reads:</p>
<p dir="auto">01-05 22:34:26.651: W/Adreno-ES20(26984): <core_glTexSubImage2D:575>: GL_INVALID_OPERATION<br>
01-05 22:34:26.651: D/OpenGLRenderer(26984): GL error from OpenGLRenderer: 0x502</p>
<p dir="auto">So the process of animating GIF somewhat trigger this (probable) driver bug when loading subsequent<br>
images.</p>
<p dir="auto">This looks to be a driver bug so I understand probably not much can be done at the library level although a workaround would be nice.</p> | 1 |
<p dir="auto">Right now, the system VPN is not working for<code class="notranslate">video_player</code> plugin in iOS. So can I set a proxy in my app?</p> | 0 |
|
<h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const makePromise = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve('FOO');
}, 500);
});
};
(async () => {
const foo = do {
try {
await makePromise();
} catch (error) {
}
};
console.log('foo', foo);
})();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">makePromise</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">resolve</span><span class="pl-kos">(</span><span class="pl-s">'FOO'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">500</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">do</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-en">makePromise</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'foo'</span><span class="pl-kos">,</span> <span class="pl-s1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": [
"transform-async-to-generator",
"transform-do-expressions"
]
}
"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
<span class="pl-s">"transform-async-to-generator"</span><span class="pl-kos">,</span>
<span class="pl-s">"transform-do-expressions"</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Expect program to output: <code class="notranslate">foo FOO</code>.</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Getting a run-time error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ babel-node ./foo.js
/test/foo.js:14
return yield makePromise();
^^^^^^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:545:28)
at loader (/test/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/test/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Function.Module.runMain (module.js:607:10)
at /test/node_modules/babel-cli/lib/_babel-node.js:159:24
at Object.<anonymous> (/test/node_modules/babel-cli/lib/_babel-node.js:160:7)"><pre class="notranslate">$ babel-node ./foo.js
/test/foo.js:14
<span class="pl-k">return</span> yield <span class="pl-en">makePromise</span>();
^^^^^^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:545:28)
at loader (/test/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/test/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Function.Module.runMain (module.js:607:10)
at /test/node_modules/babel-cli/lib/_babel-node.js:159:24
at Object.<span class="pl-k"><</span>anonymous<span class="pl-k">></span> (/test/node_modules/babel-cli/lib/_babel-node.js:160:7)</pre></div>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.18.0</td>
</tr>
<tr>
<td>node</td>
<td>v7.0.0</td>
</tr>
<tr>
<td>npm</td>
<td>3.10.8</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS v16.1.0</td>
</tr>
</tbody>
</table> | <blockquote>
<p dir="auto">Issue originally made by @AppShipIt</p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.3.17</li>
<li><strong>Node version:</strong> 5.0.0</li>
<li><strong>npm version:</strong> 3.5.1</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"presets": [
"es2015",
"stage-0"
]
}"><pre class="notranslate"><code class="notranslate">{
"presets": [
"es2015",
"stage-0"
]
}
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const testSwitch = () => do {
switch (new Date().getDay()) {
case 0: case 6: "weekend 🚵"; break
default: "weekday 🚴"
}
}
alert(`Today is a ${testSwitch() || "🐛"}`)"><pre class="notranslate"><code class="notranslate">const testSwitch = () => do {
switch (new Date().getDay()) {
case 0: case 6: "weekend 🚵"; break
default: "weekday 🚴"
}
}
alert(`Today is a ${testSwitch() || "🐛"}`)
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">Per [[ https://twitter.com/BrendanEich/status/676497551495856129 | tweet ]] from Brendan Eich:</p>
<h3 dir="auto">Expected</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""use strict";
var testSwitch = function testSwitch() {
return (function () {
switch (new Date().getDay()) {
case 0:case 6:
return "weekend 🚵";
default:
return "weekday 🚴";
}
})();
};
alert("Today is a " + (testSwitch() || "🐛"));"><pre class="notranslate"><code class="notranslate">"use strict";
var testSwitch = function testSwitch() {
return (function () {
switch (new Date().getDay()) {
case 0:case 6:
return "weekend 🚵";
default:
return "weekday 🚴";
}
})();
};
alert("Today is a " + (testSwitch() || "🐛"));
</code></pre></div>
<h3 dir="auto">Got</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""use strict";
var testSwitch = function testSwitch() {
return (function () {
switch (new Date().getDay()) {
case 0:case 6:
"weekend 🚵";break;
default:
"weekday 🚴";
}
})();
};
alert("Today is a " + (testSwitch() || "🐛"));"><pre class="notranslate"><code class="notranslate">"use strict";
var testSwitch = function testSwitch() {
return (function () {
switch (new Date().getDay()) {
case 0:case 6:
"weekend 🚵";break;
default:
"weekday 🚴";
}
})();
};
alert("Today is a " + (testSwitch() || "🐛"));
</code></pre></div>
<p dir="auto">[[ http://codepen.io/dnalot/pen/VewJez | Live demo ]]</p> | 1 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="memo" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji> Provide a description of the new feature</h2>
<p dir="auto"><em>What is the expected behavior of the proposed feature? What is the scenario this would be used?</em></p>
<p dir="auto">--- 3 finger swipe up shows the windows tabs, . Would be nice if we can remap certain keys for the finger gestures as well.</p>
<p dir="auto">If you'd like to see this feature implemented, add a <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> reaction to this post.</p> | <p dir="auto">would be nice if I could launch using the Touchpad settings for Taps with Three-finger gestures.</p> | 1 |
<p dir="auto">The "JQurey's <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="0d2cbc5fdb5017ef1498a347d55521ac">$.getJSON" link in the Zipline's, instead of opening the getJSON document, link to the $</math-renderer>.each document.</p> | <h4 dir="auto">Issue Description</h4>
<p dir="auto">I've compiled a few thoughts of what I think could be improved for the "Create a Set"-challenges of the "Coding Interview Data Structure Questions" section. <strong>See the comments in the code below</strong> (which FYI, was the solution I created when working through them).</p>
<p dir="auto">This is partially covered by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="207095293" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/13312" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/13312/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/13312">#13312</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="207078136" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/13303" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/13303/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/13303">#13303</a>, but I felt that these suggestions were to much to just be a comment of any of those issues.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// NOTE: This code should probably not be used to update the challengeSeed.
// However, it demonstrates some of the issues.
class Set {
// TODO: Add the requirement that the constructor should handle input.
// It should be possible to create a new set based on an array of items,
// where duplicates gets removed.
constructor (items = []) {
this._set = []
for (const x of items) {
this.add(x)
}
}
has (x) {
return this._set.includes(x)
}
values () {
// TODO: Make sure a copy is returned
// As JS objects always are passed by reference, returning out
// internal store would allow external code to mutate our private state.
// Because of this, we need to return a copy.
return this._set.slice()
}
add (x) {
// TODO: improve tests - ensure boolean status is returned
// At least to increase concistency, as some challenges have seed code
// returning booleans, even though previous challenges doesn't test for it.
if (this.has(x)) return false
this._set.push(x)
return true
}
remove (x) {
// TODO: improve tests - ensure boolean status is returned
// At least to increase concistency, as some challenges have seed code
// returning booleans, even though previous challenges doesn't test for it.
if (!this.has(x)) return false
this._set.splice(this._set.indexOf(x), 1)
return true
}
size () {
return this._set.length
}
union (other) {
// TODO: We should encourage the use of pure methods
// that return a result rather than modifying the input.
// Returning a new set would be a solution for this.
return new Set(
this._set.concat(other.values())
)
}
intersection (other) {
// TODO: Check for missing `)`
// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L462-L463
const values = other.values()
const common = this._set.filter(x => values.includes(x))
.concat(values.filter(x => this._set.includes(x)))
return new Set(common)
}
difference (other) {
// TODO: Check for missing `)`
// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L538-L539
const values = other.values()
const diff = this._set.filter(x => !values.includes(x))
.concat(values.filter(x => !this._set.includes(x)))
return new Set(diff)
}
subset (other) {
// TODO: Check for missing `)`
// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L625-L626
return other.values()
.every(x => this._set.includes(x))
}
}"><pre class="notranslate"><span class="pl-c">// NOTE: This code should probably not be used to update the challengeSeed.</span>
<span class="pl-c">// However, it demonstrates some of the issues.</span>
<span class="pl-k">class</span> <span class="pl-v">Set</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: Add the requirement that the constructor should handle input.</span>
<span class="pl-c">// It should be possible to create a new set based on an array of items,</span>
<span class="pl-c">// where duplicates gets removed.</span>
<span class="pl-en">constructor</span> <span class="pl-kos">(</span><span class="pl-s1">items</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">x</span> <span class="pl-k">of</span> <span class="pl-s1">items</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-en">has</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">values</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: Make sure a copy is returned</span>
<span class="pl-c">// As JS objects always are passed by reference, returning out</span>
<span class="pl-c">// internal store would allow external code to mutate our private state.</span>
<span class="pl-c">// Because of this, we need to return a copy.</span>
<span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">slice</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">add</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: improve tests - ensure boolean status is returned</span>
<span class="pl-c">// At least to increase concistency, as some challenges have seed code</span>
<span class="pl-c">// returning booleans, even though previous challenges doesn't test for it.</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">has</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-c1">false</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-c1">true</span>
<span class="pl-kos">}</span>
<span class="pl-en">remove</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: improve tests - ensure boolean status is returned</span>
<span class="pl-c">// At least to increase concistency, as some challenges have seed code</span>
<span class="pl-c">// returning booleans, even though previous challenges doesn't test for it.</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">has</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-c1">false</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">splice</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">indexOf</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-c1">true</span>
<span class="pl-kos">}</span>
<span class="pl-en">size</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-c1">length</span>
<span class="pl-kos">}</span>
<span class="pl-en">union</span> <span class="pl-kos">(</span><span class="pl-s1">other</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: We should encourage the use of pure methods</span>
<span class="pl-c">// that return a result rather than modifying the input.</span>
<span class="pl-c">// Returning a new set would be a solution for this.</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Set</span><span class="pl-kos">(</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">other</span><span class="pl-kos">.</span><span class="pl-en">values</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">intersection</span> <span class="pl-kos">(</span><span class="pl-s1">other</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: Check for missing `)`</span>
<span class="pl-c">// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L462-L463</span>
<span class="pl-k">const</span> <span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-s1">other</span><span class="pl-kos">.</span><span class="pl-en">values</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">common</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=></span> <span class="pl-s1">values</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">values</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=></span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Set</span><span class="pl-kos">(</span><span class="pl-s1">common</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">difference</span> <span class="pl-kos">(</span><span class="pl-s1">other</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: Check for missing `)`</span>
<span class="pl-c">// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L538-L539</span>
<span class="pl-k">const</span> <span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-s1">other</span><span class="pl-kos">.</span><span class="pl-en">values</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">diff</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=></span> <span class="pl-c1">!</span><span class="pl-s1">values</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">values</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=></span> <span class="pl-c1">!</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Set</span><span class="pl-kos">(</span><span class="pl-s1">diff</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">subset</span> <span class="pl-kos">(</span><span class="pl-s1">other</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// TODO: Check for missing `)`</span>
<span class="pl-c">// https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/seed/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json#L625-L626</span>
<span class="pl-k">return</span> <span class="pl-s1">other</span><span class="pl-kos">.</span><span class="pl-en">values</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">every</span><span class="pl-kos">(</span><span class="pl-s1">x</span> <span class="pl-c1">=></span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_set</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">What do you think of these suggested changes? <g-emoji class="g-emoji" alias="blush" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f60a.png">😊</g-emoji></p> | 0 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22Issue+Type%3A+Feature+Request%22+">issues list</a><br>
for similar or identical feature requests.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?utf8=%E2%9C%93&q=is%3Apr+label%3A%22PR+Type%3A+Feature%22+">pull requests list</a><br>
for existing proposed implementations of this feature.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the if the same feature was already implemented in the<br>
master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="523300112" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5830" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/5830/hovercard" href="https://github.com/celery/celery/issues/5830">#5830</a></li>
<li><a href="https://groups.google.com/g/celery-users/c/IGOBnp4n0gU" rel="nofollow">https://groups.google.com/g/celery-users/c/IGOBnp4n0gU</a></li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Brief Summary</h1>
<p dir="auto">Currently, the only way to use <code class="notranslate">joblib</code> and <code class="notranslate">loky</code> (in some extent <code class="notranslate">multiprocessing</code> too) is to use <code class="notranslate">-P threads</code> instead of <code class="notranslate">-P processes</code>.</p>
<p dir="auto">Since <code class="notranslate">-P threads</code> is using <code class="notranslate">ThreadPoolExecutor</code> from the stdlib under the hood, the task in the same worker is not really running in parallel (but async). This is because of the Python GIL.</p>
<p dir="auto">The problem becomes even more important if the workload is split between the main code and the subprocesses (executed by <code class="notranslate">joblib</code>).</p>
<p dir="auto">Only the subprocesses are executed in parallel but not the main code. It adds a clear bottleneck that is not ideal.</p>
<h1 dir="auto">Architectural Considerations</h1>
<p dir="auto">I am not comfortable enough with Celery to propose an implementation. Feel free to throw your ideas below in this ticket.</p>
<h1 dir="auto">Potential workaround</h1>
<p dir="auto">A potential workaround is to have plenty of Celery worker replicas that execute only one task (concurrency of 1). So the task will have all the CPU time available for it and be free to use <code class="notranslate">joblib</code> at its convenience.</p>
<p dir="auto">But having all the Celery workers with a concurrency of 1 also imply some overhead in the underlying infrastructure that is not really wanted ideally.</p> | <p dir="auto">When using gevent as a pool, queuing a single task that uses <a href="https://channels.readthedocs.io/en/stable/topics/channel_layers.html#synchronous-functions" rel="nofollow">django-channel's group_send with async_to_sync</a> works, but queuing multiple tasks will result in the following error:</p>
<p dir="auto"><code class="notranslate">RuntimeError: You cannot use AsyncToSync in the same thread as an async event loop - just await the async function directly.</code></p>
<p dir="auto">Seems like celery is conditionally creating an event loop in the worker depending on load? I originally noticed this behavior when upgrading to celery 5.2.6 from 4.4.0 (and as a result python 3.7)</p>
<p dir="auto">Here's a repo with a reproducible test case: <a href="https://github.com/udbhav/celery-channels-test">https://github.com/udbhav/celery-channels-test</a></p>
<p dir="auto">Thanks in advance for looking at this and any help/insight you can provide.</p>
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="https://docs.celeryq.dev/en/master/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>:</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -> celery:5.2.6 (dawn-chorus) kombu:5.2.4 py:3.7.13
billiard:3.6.4.0 py-amqp:5.1.0
platform -> system:Linux arch:64bit, ELF
kernel version:5.10.47-linuxkit imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:disabled
ABSOLUTE_URL_OVERRIDES: {
}
ADMINS: []
ALLOWED_HOSTS: []
APPEND_SLASH: True
ASGI_APPLICATION: 'celery_channels_test.asgi.application'
AUTHENTICATION_BACKENDS: ['django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS: '********'
AUTH_USER_MODEL: 'auth.User'
BASE_DIR: PosixPath('/code/src')
CACHES: {
'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS: 'default'
CACHE_MIDDLEWARE_KEY_PREFIX: '********'
CACHE_MIDDLEWARE_SECONDS: 600
CELERY_BROKER_URL: 'amqp://test:********@rabbit:5672//'
CELERY_TIMEZONE: 'UTC'
CHANNEL_LAYERS: {
'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [('cache', 6379)]}}}
CSRF_COOKIE_AGE: 31449600
CSRF_COOKIE_DOMAIN: None
CSRF_COOKIE_HTTPONLY: False
CSRF_COOKIE_NAME: 'csrftoken'
CSRF_COOKIE_PATH: '/'
CSRF_COOKIE_SAMESITE: 'Lax'
CSRF_COOKIE_SECURE: False
CSRF_FAILURE_VIEW: 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME: 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS: []
CSRF_USE_SESSIONS: False
DATABASES: {
'default': { 'ATOMIC_REQUESTS': False,
'AUTOCOMMIT': True,
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.sqlite3',
'HOST': '',
'NAME': PosixPath('/code/src/db.sqlite3'),
'OPTIONS': {},
'PASSWORD': '********',
'PORT': '',
'TEST': { 'CHARSET': None,
'COLLATION': None,
'MIGRATE': True,
'MIRROR': None,
'NAME': None},
'TIME_ZONE': None,
'USER': ''}}
DATABASE_ROUTERS: '********'
DATA_UPLOAD_MAX_MEMORY_SIZE: 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS: 1000
DATETIME_FORMAT: 'N j, Y, P'
DATETIME_INPUT_FORMATS: ['%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M']
DATE_FORMAT: 'N j, Y'
DATE_INPUT_FORMATS: ['%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y']
DEBUG: True
DEBUG_PROPAGATE_EXCEPTIONS: False
DECIMAL_SEPARATOR: '.'
DEFAULT_AUTO_FIELD: 'django.db.models.BigAutoField'
DEFAULT_CHARSET: 'utf-8'
DEFAULT_EXCEPTION_REPORTER: 'django.views.debug.ExceptionReporter'
DEFAULT_EXCEPTION_REPORTER_FILTER: 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL: 'webmaster@localhost'
DEFAULT_HASHING_ALGORITHM: 'sha256'
DEFAULT_INDEX_TABLESPACE: ''
DEFAULT_TABLESPACE: ''
DISALLOWED_USER_AGENTS: []
EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST: 'localhost'
EMAIL_HOST_PASSWORD: '********'
EMAIL_HOST_USER: ''
EMAIL_PORT: 25
EMAIL_SSL_CERTFILE: None
EMAIL_SSL_KEYFILE: '********'
EMAIL_SUBJECT_PREFIX: '[Django] '
EMAIL_TIMEOUT: None
EMAIL_USE_LOCALTIME: False
EMAIL_USE_SSL: False
EMAIL_USE_TLS: False
FILE_UPLOAD_DIRECTORY_PERMISSIONS: None
FILE_UPLOAD_HANDLERS: ['django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE: 2621440
FILE_UPLOAD_PERMISSIONS: 420
FILE_UPLOAD_TEMP_DIR: None
FIRST_DAY_OF_WEEK: 0
FIXTURE_DIRS: []
FORCE_SCRIPT_NAME: None
FORMAT_MODULE_PATH: None
FORM_RENDERER: 'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS: []
INSTALLED_APPS: ['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'channels']
INTERNAL_IPS: []
LANGUAGES: [('af', 'Afrikaans'),
('ar', 'Arabic'),
('ar-dz', 'Algerian Arabic'),
('ast', 'Asturian'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('dsb', 'Lower Sorbian'),
('el', 'Greek'),
('en', 'English'),
('en-au', 'Australian English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-co', 'Colombian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy', 'Frisian'),
('ga', 'Irish'),
('gd', 'Scottish Gaelic'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hsb', 'Upper Sorbian'),
('hu', 'Hungarian'),
('hy', 'Armenian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('ig', 'Igbo'),
('io', 'Ido'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kab', 'Kabyle'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('ky', 'Kyrgyz'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('mr', 'Marathi'),
('my', 'Burmese'),
('nb', 'Norwegian Bokmål'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('os', 'Ossetic'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('tg', 'Tajik'),
('th', 'Thai'),
('tk', 'Turkmen'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('uz', 'Uzbek'),
('vi', 'Vietnamese'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI: ['he', 'ar', 'ar-dz', 'fa', 'ur']
LANGUAGE_CODE: 'en-us'
LANGUAGE_COOKIE_AGE: None
LANGUAGE_COOKIE_DOMAIN: None
LANGUAGE_COOKIE_HTTPONLY: False
LANGUAGE_COOKIE_NAME: 'django_language'
LANGUAGE_COOKIE_PATH: '/'
LANGUAGE_COOKIE_SAMESITE: None
LANGUAGE_COOKIE_SECURE: False
LOCALE_PATHS: []
LOGGING: {
'disable_existing_loggers': False,
'formatters': { 'timestamp': { 'format': '[{asctime}] {levelname} '
'[{name}]: {message}',
'style': '{'}},
'handlers': { 'console': { 'class': 'logging.StreamHandler',
'formatter': 'timestamp',
'level': 'DEBUG'}},
'loggers': { 'celery': {'handlers': ['console'], 'level': 'DEBUG'},
'django': {'handlers': ['console'], 'level': 'INFO'}},
'version': 1}
LOGGING_CONFIG: 'logging.config.dictConfig'
LOGIN_REDIRECT_URL: '/accounts/profile/'
LOGIN_URL: '/accounts/login/'
LOGOUT_REDIRECT_URL: None
MANAGERS: []
MEDIA_ROOT: ''
MEDIA_URL: '/'
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE: ['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
MIGRATION_MODULES: {
}
MONTH_DAY_FORMAT: 'F j'
NUMBER_GROUPING: 0
PASSWORD_HASHERS: '********'
PASSWORD_RESET_TIMEOUT: '********'
PASSWORD_RESET_TIMEOUT_DAYS: '********'
PREPEND_WWW: False
ROOT_URLCONF: 'celery_channels_test.urls'
SECRET_KEY: '********'
SECURE_BROWSER_XSS_FILTER: False
SECURE_CONTENT_TYPE_NOSNIFF: True
SECURE_HSTS_INCLUDE_SUBDOMAINS: False
SECURE_HSTS_PRELOAD: False
SECURE_HSTS_SECONDS: 0
SECURE_PROXY_SSL_HEADER: None
SECURE_REDIRECT_EXEMPT: []
SECURE_REFERRER_POLICY: 'same-origin'
SECURE_SSL_HOST: None
SECURE_SSL_REDIRECT: False
SERVER_EMAIL: 'root@localhost'
SESSION_CACHE_ALIAS: 'default'
SESSION_COOKIE_AGE: 1209600
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_NAME: 'sessionid'
SESSION_COOKIE_PATH: '/'
SESSION_COOKIE_SAMESITE: 'Lax'
SESSION_COOKIE_SECURE: False
SESSION_ENGINE: 'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE: False
SESSION_FILE_PATH: None
SESSION_SAVE_EVERY_REQUEST: False
SESSION_SERIALIZER: 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE: 'celery_channels_test.settings'
SHORT_DATETIME_FORMAT: 'm/d/Y P'
SHORT_DATE_FORMAT: 'm/d/Y'
SIGNING_BACKEND: 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS: []
STATICFILES_DIRS: []
STATICFILES_FINDERS: ['django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT: None
STATIC_URL: '/static/'
TEMPLATES: [{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages']}}]
TEST_NON_SERIALIZED_APPS: []
TEST_RUNNER: 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR: ','
TIME_FORMAT: 'P'
TIME_INPUT_FORMATS: ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE: 'UTC'
USE_I18N: True
USE_L10N: True
USE_THOUSAND_SEPARATOR: False
USE_TZ: True
USE_X_FORWARDED_HOST: False
USE_X_FORWARDED_PORT: False
WSGI_APPLICATION: 'celery_channels_test.wsgi.application'
X_FRAME_OPTIONS: 'DENY'
YEAR_MONTH_FORMAT: 'F Y'
is_overridden: <bound method Settings.is_overridden of <Settings "celery_channels_test.settings">>
deprecated_settings: None"><pre class="notranslate"><code class="notranslate">software -> celery:5.2.6 (dawn-chorus) kombu:5.2.4 py:3.7.13
billiard:3.6.4.0 py-amqp:5.1.0
platform -> system:Linux arch:64bit, ELF
kernel version:5.10.47-linuxkit imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:pyamqp results:disabled
ABSOLUTE_URL_OVERRIDES: {
}
ADMINS: []
ALLOWED_HOSTS: []
APPEND_SLASH: True
ASGI_APPLICATION: 'celery_channels_test.asgi.application'
AUTHENTICATION_BACKENDS: ['django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS: '********'
AUTH_USER_MODEL: 'auth.User'
BASE_DIR: PosixPath('/code/src')
CACHES: {
'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS: 'default'
CACHE_MIDDLEWARE_KEY_PREFIX: '********'
CACHE_MIDDLEWARE_SECONDS: 600
CELERY_BROKER_URL: 'amqp://test:********@rabbit:5672//'
CELERY_TIMEZONE: 'UTC'
CHANNEL_LAYERS: {
'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [('cache', 6379)]}}}
CSRF_COOKIE_AGE: 31449600
CSRF_COOKIE_DOMAIN: None
CSRF_COOKIE_HTTPONLY: False
CSRF_COOKIE_NAME: 'csrftoken'
CSRF_COOKIE_PATH: '/'
CSRF_COOKIE_SAMESITE: 'Lax'
CSRF_COOKIE_SECURE: False
CSRF_FAILURE_VIEW: 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME: 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS: []
CSRF_USE_SESSIONS: False
DATABASES: {
'default': { 'ATOMIC_REQUESTS': False,
'AUTOCOMMIT': True,
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.sqlite3',
'HOST': '',
'NAME': PosixPath('/code/src/db.sqlite3'),
'OPTIONS': {},
'PASSWORD': '********',
'PORT': '',
'TEST': { 'CHARSET': None,
'COLLATION': None,
'MIGRATE': True,
'MIRROR': None,
'NAME': None},
'TIME_ZONE': None,
'USER': ''}}
DATABASE_ROUTERS: '********'
DATA_UPLOAD_MAX_MEMORY_SIZE: 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS: 1000
DATETIME_FORMAT: 'N j, Y, P'
DATETIME_INPUT_FORMATS: ['%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M']
DATE_FORMAT: 'N j, Y'
DATE_INPUT_FORMATS: ['%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y']
DEBUG: True
DEBUG_PROPAGATE_EXCEPTIONS: False
DECIMAL_SEPARATOR: '.'
DEFAULT_AUTO_FIELD: 'django.db.models.BigAutoField'
DEFAULT_CHARSET: 'utf-8'
DEFAULT_EXCEPTION_REPORTER: 'django.views.debug.ExceptionReporter'
DEFAULT_EXCEPTION_REPORTER_FILTER: 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL: 'webmaster@localhost'
DEFAULT_HASHING_ALGORITHM: 'sha256'
DEFAULT_INDEX_TABLESPACE: ''
DEFAULT_TABLESPACE: ''
DISALLOWED_USER_AGENTS: []
EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST: 'localhost'
EMAIL_HOST_PASSWORD: '********'
EMAIL_HOST_USER: ''
EMAIL_PORT: 25
EMAIL_SSL_CERTFILE: None
EMAIL_SSL_KEYFILE: '********'
EMAIL_SUBJECT_PREFIX: '[Django] '
EMAIL_TIMEOUT: None
EMAIL_USE_LOCALTIME: False
EMAIL_USE_SSL: False
EMAIL_USE_TLS: False
FILE_UPLOAD_DIRECTORY_PERMISSIONS: None
FILE_UPLOAD_HANDLERS: ['django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE: 2621440
FILE_UPLOAD_PERMISSIONS: 420
FILE_UPLOAD_TEMP_DIR: None
FIRST_DAY_OF_WEEK: 0
FIXTURE_DIRS: []
FORCE_SCRIPT_NAME: None
FORMAT_MODULE_PATH: None
FORM_RENDERER: 'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS: []
INSTALLED_APPS: ['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'channels']
INTERNAL_IPS: []
LANGUAGES: [('af', 'Afrikaans'),
('ar', 'Arabic'),
('ar-dz', 'Algerian Arabic'),
('ast', 'Asturian'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('dsb', 'Lower Sorbian'),
('el', 'Greek'),
('en', 'English'),
('en-au', 'Australian English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-co', 'Colombian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy', 'Frisian'),
('ga', 'Irish'),
('gd', 'Scottish Gaelic'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hsb', 'Upper Sorbian'),
('hu', 'Hungarian'),
('hy', 'Armenian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('ig', 'Igbo'),
('io', 'Ido'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kab', 'Kabyle'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('ky', 'Kyrgyz'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('mr', 'Marathi'),
('my', 'Burmese'),
('nb', 'Norwegian Bokmål'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('os', 'Ossetic'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('tg', 'Tajik'),
('th', 'Thai'),
('tk', 'Turkmen'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('uz', 'Uzbek'),
('vi', 'Vietnamese'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI: ['he', 'ar', 'ar-dz', 'fa', 'ur']
LANGUAGE_CODE: 'en-us'
LANGUAGE_COOKIE_AGE: None
LANGUAGE_COOKIE_DOMAIN: None
LANGUAGE_COOKIE_HTTPONLY: False
LANGUAGE_COOKIE_NAME: 'django_language'
LANGUAGE_COOKIE_PATH: '/'
LANGUAGE_COOKIE_SAMESITE: None
LANGUAGE_COOKIE_SECURE: False
LOCALE_PATHS: []
LOGGING: {
'disable_existing_loggers': False,
'formatters': { 'timestamp': { 'format': '[{asctime}] {levelname} '
'[{name}]: {message}',
'style': '{'}},
'handlers': { 'console': { 'class': 'logging.StreamHandler',
'formatter': 'timestamp',
'level': 'DEBUG'}},
'loggers': { 'celery': {'handlers': ['console'], 'level': 'DEBUG'},
'django': {'handlers': ['console'], 'level': 'INFO'}},
'version': 1}
LOGGING_CONFIG: 'logging.config.dictConfig'
LOGIN_REDIRECT_URL: '/accounts/profile/'
LOGIN_URL: '/accounts/login/'
LOGOUT_REDIRECT_URL: None
MANAGERS: []
MEDIA_ROOT: ''
MEDIA_URL: '/'
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE: ['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
MIGRATION_MODULES: {
}
MONTH_DAY_FORMAT: 'F j'
NUMBER_GROUPING: 0
PASSWORD_HASHERS: '********'
PASSWORD_RESET_TIMEOUT: '********'
PASSWORD_RESET_TIMEOUT_DAYS: '********'
PREPEND_WWW: False
ROOT_URLCONF: 'celery_channels_test.urls'
SECRET_KEY: '********'
SECURE_BROWSER_XSS_FILTER: False
SECURE_CONTENT_TYPE_NOSNIFF: True
SECURE_HSTS_INCLUDE_SUBDOMAINS: False
SECURE_HSTS_PRELOAD: False
SECURE_HSTS_SECONDS: 0
SECURE_PROXY_SSL_HEADER: None
SECURE_REDIRECT_EXEMPT: []
SECURE_REFERRER_POLICY: 'same-origin'
SECURE_SSL_HOST: None
SECURE_SSL_REDIRECT: False
SERVER_EMAIL: 'root@localhost'
SESSION_CACHE_ALIAS: 'default'
SESSION_COOKIE_AGE: 1209600
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_NAME: 'sessionid'
SESSION_COOKIE_PATH: '/'
SESSION_COOKIE_SAMESITE: 'Lax'
SESSION_COOKIE_SECURE: False
SESSION_ENGINE: 'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE: False
SESSION_FILE_PATH: None
SESSION_SAVE_EVERY_REQUEST: False
SESSION_SERIALIZER: 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE: 'celery_channels_test.settings'
SHORT_DATETIME_FORMAT: 'm/d/Y P'
SHORT_DATE_FORMAT: 'm/d/Y'
SIGNING_BACKEND: 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS: []
STATICFILES_DIRS: []
STATICFILES_FINDERS: ['django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT: None
STATIC_URL: '/static/'
TEMPLATES: [{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages']}}]
TEST_NON_SERIALIZED_APPS: []
TEST_RUNNER: 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR: ','
TIME_FORMAT: 'P'
TIME_INPUT_FORMATS: ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE: 'UTC'
USE_I18N: True
USE_L10N: True
USE_THOUSAND_SEPARATOR: False
USE_TZ: True
USE_X_FORWARDED_HOST: False
USE_X_FORWARDED_PORT: False
WSGI_APPLICATION: 'celery_channels_test.wsgi.application'
X_FRAME_OPTIONS: 'DENY'
YEAR_MONTH_FORMAT: 'F Y'
is_overridden: <bound method Settings.is_overridden of <Settings "celery_channels_test.settings">>
deprecated_settings: None
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 3.7</li>
<li><strong>Minimal Celery Version</strong>: 5.2.6</li>
<li><strong>Minimal Kombu Version</strong>: 5.2.4</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="aioredis==1.3.1
amqp==5.1.0
asgiref==3.5.0
async-timeout==4.0.2
attrs==21.4.0
autobahn==22.3.2
Automat==20.2.0
billiard==3.6.4.0
cached-property==1.5.2
celery==5.2.6
cffi==1.15.0
channels==3.0.4
channels-redis==3.4.0
click==8.1.2
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
constantly==15.1.0
cryptography==36.0.2
daphne==3.0.2
Django==3.2.13
gevent==21.12.0
greenlet==1.1.2
hiredis==2.0.0
hyperlink==21.0.0
idna==3.3
importlib-metadata==4.11.3
incremental==21.3.0
kombu==5.2.4
msgpack==1.0.3
prompt-toolkit==3.0.29
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pyOpenSSL==22.0.0
pytz==2022.1
service-identity==21.1.0
six==1.16.0
sqlparse==0.4.2
Twisted==22.4.0
txaio==22.2.1
typing_extensions==4.1.1
vine==5.0.0
wcwidth==0.2.5
zipp==3.8.0
zope.event==4.5.0
zope.interface==5.4.0"><pre class="notranslate"><code class="notranslate">aioredis==1.3.1
amqp==5.1.0
asgiref==3.5.0
async-timeout==4.0.2
attrs==21.4.0
autobahn==22.3.2
Automat==20.2.0
billiard==3.6.4.0
cached-property==1.5.2
celery==5.2.6
cffi==1.15.0
channels==3.0.4
channels-redis==3.4.0
click==8.1.2
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
constantly==15.1.0
cryptography==36.0.2
daphne==3.0.2
Django==3.2.13
gevent==21.12.0
greenlet==1.1.2
hiredis==2.0.0
hyperlink==21.0.0
idna==3.3
importlib-metadata==4.11.3
incremental==21.3.0
kombu==5.2.4
msgpack==1.0.3
prompt-toolkit==3.0.29
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pyOpenSSL==22.0.0
pytz==2022.1
service-identity==21.1.0
six==1.16.0
sqlparse==0.4.2
Twisted==22.4.0
txaio==22.2.1
typing_extensions==4.1.1
vine==5.0.0
wcwidth==0.2.5
zipp==3.8.0
zope.event==4.5.0
zope.interface==5.4.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<p dir="auto">Here's a repo with a reproducible test case: <a href="https://github.com/udbhav/celery-channels-test">https://github.com/udbhav/celery-channels-test</a></p>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">I would expect celery to behave the same when it comes to event loops regardless of load. There should either be an event loop created on startup or not. Having there be an event loop sometimes makes it difficult to write proper async code</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">There is no event loop initially, and then one after queueing multiple tasks</p> | 0 |
<p dir="auto">Hello,</p>
<p dir="auto">I spent a few hours debugging my system the other day because my disk was full - not because of space but because of inodes. In fact, it was the cache sessions directory that was full of sess_* files.</p>
<p dir="auto">As it was already stated in pr <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="953389" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/1097" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/1097/hovercard" href="https://github.com/symfony/symfony/pull/1097">#1097</a>, on systems like Debian, the default session.gc_probability is defined to 0, and a cron task takes care of the /var/lib/php5 directory, which is the default session.save_path.</p>
<p dir="auto">But by default, Symfony changes that behavior and puts the sessions in the cache directory of the environment, which is then never garbage collected. If you don't "cache:clear" your environment periodically, you'll be running out of inodes sooner or later (I had some scripts using my webservices, which created sessions over and over again).</p>
<p dir="auto">I think this issue should be at least documented in session management of the HttpFoundation. But maybe I could also modify the cache:clear task or create a new one, that would only run the garbage collection of sessions. Or do you think it is enough to document that you need to modify the /etc/cron.d/php5 file to change the directory and add more lines for the different environments ?</p>
<p dir="auto">Regards.</p> | <p dir="auto">I had a strange behavior while learning with the Symfony Book Chapter "Forms".</p>
<p dir="auto">For revision:</p>
<ol dir="auto">
<li>Creating the Class:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// src/Acme/TaskBundle/Entity/Task.php
namespace Acme\TaskBundle\Entity;
class Task
{
protected $task;
protected $dueDate;
public function getTask()
{
return $this->task;
}
public function setTask($task)
{
$this->task = $task;
}
public function getDueDate()
{
return $this->dueDate;
}
public function setDueDate(\DateTime $dueDate = null)
{
$this->dueDate = $dueDate;
}
}"><pre class="notranslate"><span class="pl-c">// src/Acme/TaskBundle/Entity/Task.php</span>
<span class="pl-k">namespace</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Entity</span>;
<span class="pl-k">class</span> <span class="pl-v">Task</span>
{
<span class="pl-k">protected</span> <span class="pl-c1"><span class="pl-c1">$</span>task</span>;
<span class="pl-k">protected</span> <span class="pl-c1"><span class="pl-c1">$</span>dueDate</span>;
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">getTask</span>()
{
<span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-c1">task</span>;
}
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">setTask</span>(<span class="pl-s1"><span class="pl-c1">$</span>task</span>)
{
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-c1">task</span> = <span class="pl-s1"><span class="pl-c1">$</span>task</span>;
}
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">getDueDate</span>()
{
<span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-c1">dueDate</span>;
}
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">setDueDate</span>(<span class="pl-smi"><span class="pl-smi">\<span class="pl-v">DateTime</span></span></span> <span class="pl-s1"><span class="pl-c1">$</span>dueDate</span> = <span class="pl-c1">null</span>)
{
<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-c1">dueDate</span> = <span class="pl-s1"><span class="pl-c1">$</span>dueDate</span>;
}
}</pre></div>
<ol dir="auto">
<li>Editing the controller:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// src/Acme/TaskBundle/Controller/DefaultController.php
namespace Acme\TaskBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Acme\TaskBundle\Entity\Task;
use Symfony\Component\HttpFoundation\Request;
class DefaultController extends Controller
{
public function newAction(Request $request)
{
// create a task and give it some dummy data for this example
$task = new Task();
$task->setTask('Write a blog post');
$task->setDueDate(new \DateTime('tomorrow'));
$form = $this->createFormBuilder($task)
->add('task', 'text')
->add('dueDate', 'date')
->getForm();
return $this->render('AcmeTaskBundle:Default:new.html.twig', array(
'form' => $form->createView(),
));
}
}"><pre class="notranslate"><span class="pl-c">// src/Acme/TaskBundle/Controller/DefaultController.php</span>
<span class="pl-k">namespace</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Controller</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Bundle</span>\<span class="pl-v">FrameworkBundle</span>\<span class="pl-v">Controller</span>\<span class="pl-v">Controller</span>;
<span class="pl-k">use</span> <span class="pl-v">Acme</span>\<span class="pl-v">TaskBundle</span>\<span class="pl-v">Entity</span>\<span class="pl-v">Task</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">HttpFoundation</span>\<span class="pl-v">Request</span>;
<span class="pl-k">class</span> <span class="pl-v">DefaultController</span> <span class="pl-k">extends</span> <span class="pl-v">Controller</span>
{
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">newAction</span>(<span class="pl-smi"><span class="pl-smi">Request</span></span> <span class="pl-s1"><span class="pl-c1">$</span>request</span>)
{
<span class="pl-c">// create a task and give it some dummy data for this example</span>
<span class="pl-s1"><span class="pl-c1">$</span>task</span> = <span class="pl-k">new</span> <span class="pl-v">Task</span>();
<span class="pl-s1"><span class="pl-c1">$</span>task</span>-><span class="pl-en">setTask</span>(<span class="pl-s">'Write a blog post'</span>);
<span class="pl-s1"><span class="pl-c1">$</span>task</span>-><span class="pl-en">setDueDate</span>(<span class="pl-k">new</span> \<span class="pl-v">DateTime</span>(<span class="pl-s">'tomorrow'</span>));
<span class="pl-s1"><span class="pl-c1">$</span>form</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-en">createFormBuilder</span>(<span class="pl-s1"><span class="pl-c1">$</span>task</span>)
-><span class="pl-en">add</span>(<span class="pl-s">'task'</span>, <span class="pl-s">'text'</span>)
-><span class="pl-en">add</span>(<span class="pl-s">'dueDate'</span>, <span class="pl-s">'date'</span>)
-><span class="pl-en">getForm</span>();
<span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-en">render</span>(<span class="pl-s">'AcmeTaskBundle:Default:new.html.twig'</span>, <span class="pl-en">array</span>(
<span class="pl-s">'form'</span> => <span class="pl-s1"><span class="pl-c1">$</span>form</span>-><span class="pl-en">createView</span>(),
));
}
}</pre></div>
<ol dir="auto">
<li>Creating the template:</li>
</ol>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{# src/Acme/TaskBundle/Resources/views/Default/new.html.twig #}
<form action="{{ path('task_new') }}" method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}
<input type="submit" />
</form>"><pre class="notranslate">{<span class="pl-c"># src/Acme/TaskBundle/Resources/views/Default/new.html.twig #}</span>
<form action="<span class="pl-s">{{ path('task_new') }}</span>" method="post"<span class="pl-s"> {{ form_enctype(form) }}></span>
<span class="pl-s"> {{ form_widget(form) }}</span>
<span class="pl-s"></span>
<span class="pl-s"> <input type=</span>"submit" />
</form></pre></div>
<p dir="auto">Following these steps I got a strange behaviour after creating the route and opening the page. The DueDate didn't look like at the picture in the book. It was more like ''Jan-012345678-2013" instead of "Jan 10, 2013". After debugging for 4 hours (I'm a web developer trainee) I found out that it has to do with the intl extension cause the date field type uses for formatting('format') per default: IntlDateFormatter::MEDIUM. After installing intl everything was alright :) But I would expect an exception at 'format' when intl is not installed.<br>
This is my first "bug" report. Any criticism would be desirable :)</p> | 0 |
<p dir="auto"><strong>Migrated issue, originally created by Derek Lambert (<a href="https://github.com/dlambert">@dlambert</a>)</strong></p>
<p dir="auto">Appologies if this explanation isn't accurate, the code is. After <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384640437" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/4116" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/4116/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/4116">#4116</a>, an association proxy specifing a property defined in a subclass no longer resolves properly.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.dialects.postgresql import UUID as saUUID
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declarative_base
from uuid import uuid4, UUID
Base = declarative_base()
class DirectoryEntry(Base):
guid = sa.Column(saUUID, primary_key=True)
directory_name = sa.Column(sa.String, default='dummy_fk', primary_key=True)
_type = sa.Column(sa.String, nullable=False)
distinguished_name = sa.Column(sa.String)
name = sa.Column(sa.String)
member_of = association_proxy('_groups', 'group')
__tablename__ = 'directory_entry'
__table_args__ = (
sa.UniqueConstraint('directory_name', 'guid'),
sa.UniqueConstraint('directory_name', 'distinguished_name'),
)
__mapper_args__ = {
'polymorphic_on': _type,
'with_polymorphic': '*'
}
class DirectoryUser(DirectoryEntry):
username = sa.Column(sa.String)
class DirectoryGroup(DirectoryEntry):
pass
class DirectoryGroupMember(Base):
guid = sa.Column(saUUID, primary_key=True, default=lambda: str(uuid4()))
directory_name = sa.Column(sa.String, primary_key=True)
distinguished_name = sa.Column(sa.String)
group_guid = sa.Column(saUUID)
member_guid = sa.Column(saUUID)
__tablename__ = 'directory_group_member'
__table_args__ = (
sa.UniqueConstraint('group_guid', 'distinguished_name'),
sa.ForeignKeyConstraint(('group_guid', 'directory_name'), ('directory_entry.guid', 'directory_entry.directory_name')),
)
class VaultEntry(DirectoryEntry):
pass
class VaultUser(DirectoryUser, VaultEntry):
_groups = orm.relationship("VaultGroupMember", primaryjoin="and_(foreign(VaultGroupMember.distinguished_name)==VaultUser.username)")
__mapper_args__ = {'polymorphic_identity': 'vault_user'}
class VaultGroup(DirectoryGroup, VaultEntry):
_groups = orm.relationship('VaultGroupMember', primaryjoin='and_(foreign(VaultGroupMember.distinguished_name)==VaultGroup.name)')
_members = orm.relationship('VaultGroupMember', backref='group')
members = association_proxy('_members', 'member', creator=lambda v: VaultGroupMember(distinguished_name=v))
__mapper_args__ = {'polymorphic_identity': 'vault_group'}
class VaultGroupMember(DirectoryGroupMember):
@property
def member(self):
return orm.object_session(self).query(DirectoryEntry).filter(sa.or_(DirectoryGroup.name == self.distinguished_name, DirectoryUser.username == self.distinguished_name)).one()
engine_url = 'postgresql+psycopg2://postgres@localhost/bad_proxy'
engine = sa.create_engine(engine_url, echo=True)
Base.metadata.create_all(engine)
Session = orm.sessionmaker(bind=engine)
sess = Session()
user1 = {
'guid': str(UUID(int=1)),
'name': 'Jon Doe',
'username': 'jon.doe'
}
group1 = {
'guid': str(UUID(int=101)),
'name': 'Group1',
'members': ['jon.doe']
}
sess.add(VaultUser(**user1))
sess.add(VaultGroup(**group1))
sess.commit()
sess.flush()
user = sess.query(DirectoryUser).filter(DirectoryUser.directory_name == 'dummy_fk').filter(DirectoryUser.username == 'jon.doe').one_or_none()
groups = list(user.member_of)
assert len(groups)
"><pre class="notranslate"><code class="notranslate">import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.dialects.postgresql import UUID as saUUID
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declarative_base
from uuid import uuid4, UUID
Base = declarative_base()
class DirectoryEntry(Base):
guid = sa.Column(saUUID, primary_key=True)
directory_name = sa.Column(sa.String, default='dummy_fk', primary_key=True)
_type = sa.Column(sa.String, nullable=False)
distinguished_name = sa.Column(sa.String)
name = sa.Column(sa.String)
member_of = association_proxy('_groups', 'group')
__tablename__ = 'directory_entry'
__table_args__ = (
sa.UniqueConstraint('directory_name', 'guid'),
sa.UniqueConstraint('directory_name', 'distinguished_name'),
)
__mapper_args__ = {
'polymorphic_on': _type,
'with_polymorphic': '*'
}
class DirectoryUser(DirectoryEntry):
username = sa.Column(sa.String)
class DirectoryGroup(DirectoryEntry):
pass
class DirectoryGroupMember(Base):
guid = sa.Column(saUUID, primary_key=True, default=lambda: str(uuid4()))
directory_name = sa.Column(sa.String, primary_key=True)
distinguished_name = sa.Column(sa.String)
group_guid = sa.Column(saUUID)
member_guid = sa.Column(saUUID)
__tablename__ = 'directory_group_member'
__table_args__ = (
sa.UniqueConstraint('group_guid', 'distinguished_name'),
sa.ForeignKeyConstraint(('group_guid', 'directory_name'), ('directory_entry.guid', 'directory_entry.directory_name')),
)
class VaultEntry(DirectoryEntry):
pass
class VaultUser(DirectoryUser, VaultEntry):
_groups = orm.relationship("VaultGroupMember", primaryjoin="and_(foreign(VaultGroupMember.distinguished_name)==VaultUser.username)")
__mapper_args__ = {'polymorphic_identity': 'vault_user'}
class VaultGroup(DirectoryGroup, VaultEntry):
_groups = orm.relationship('VaultGroupMember', primaryjoin='and_(foreign(VaultGroupMember.distinguished_name)==VaultGroup.name)')
_members = orm.relationship('VaultGroupMember', backref='group')
members = association_proxy('_members', 'member', creator=lambda v: VaultGroupMember(distinguished_name=v))
__mapper_args__ = {'polymorphic_identity': 'vault_group'}
class VaultGroupMember(DirectoryGroupMember):
@property
def member(self):
return orm.object_session(self).query(DirectoryEntry).filter(sa.or_(DirectoryGroup.name == self.distinguished_name, DirectoryUser.username == self.distinguished_name)).one()
engine_url = 'postgresql+psycopg2://postgres@localhost/bad_proxy'
engine = sa.create_engine(engine_url, echo=True)
Base.metadata.create_all(engine)
Session = orm.sessionmaker(bind=engine)
sess = Session()
user1 = {
'guid': str(UUID(int=1)),
'name': 'Jon Doe',
'username': 'jon.doe'
}
group1 = {
'guid': str(UUID(int=101)),
'name': 'Group1',
'members': ['jon.doe']
}
sess.add(VaultUser(**user1))
sess.add(VaultGroup(**group1))
sess.commit()
sess.flush()
user = sess.query(DirectoryUser).filter(DirectoryUser.directory_name == 'dummy_fk').filter(DirectoryUser.username == 'jon.doe').one_or_none()
groups = list(user.member_of)
assert len(groups)
</code></pre></div>
<p dir="auto">This works in 1.2.2, with 1.2.3 raises exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/orm/mapper.py", line 1922, in get_property
return self._props[key]
KeyError: '_groups'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bad_proxy2.py", line 100, in <module>
groups = list(user.member_of)
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 283, in __get__
if self.scalar:
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/util/langhelpers.py", line 767, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 238, in scalar
scalar = not self._get_property().uselist
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 221, in _get_property
get_property(self.target_collection))
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/orm/mapper.py", line 1925, in get_property
"Mapper '%s' has no property '%s'" % (self, key))
sqlalchemy.exc.InvalidRequestError: Mapper 'Mapper|DirectoryEntry|directory_entry' has no property '_groups'
"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/orm/mapper.py", line 1922, in get_property
return self._props[key]
KeyError: '_groups'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bad_proxy2.py", line 100, in <module>
groups = list(user.member_of)
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 283, in __get__
if self.scalar:
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/util/langhelpers.py", line 767, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 238, in scalar
scalar = not self._get_property().uselist
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/ext/associationproxy.py", line 221, in _get_property
get_property(self.target_collection))
File "/Users/dereklambert/Library/Python/3.6/lib/python/site-packages/sqlalchemy/orm/mapper.py", line 1925, in get_property
"Mapper '%s' has no property '%s'" % (self, key))
sqlalchemy.exc.InvalidRequestError: Mapper 'Mapper|DirectoryEntry|directory_entry' has no property '_groups'
</code></pre></div>
<p dir="auto">Python 3.6.4<br>
PostgreSQL 10<br>
psycopg2 2.7.3.2</p> | <p dir="auto"><strong>Migrated issue, originally created by Brendan Abel (<a href="https://github.com/babel">@babel</a>)</strong></p>
<p dir="auto">This is using sqlalchemy 0.9.8</p>
<p dir="auto">Assuming a declarative class called "MyClass" with an association proxy field call "my_field"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> ap = MyClass.__mapper__.all_orm_descriptors['my_field']
>>> ap.owning_class
None
>>> ap = MyClass.my_field
>>> ap.owning_class
<class 'MyClass'>
>>> ap = MyClass.__mapper__.all_orm_descriptors['my_field']
>>> ap.owning_class
<class 'MyClass'>"><pre class="notranslate"><code class="notranslate">>>> ap = MyClass.__mapper__.all_orm_descriptors['my_field']
>>> ap.owning_class
None
>>> ap = MyClass.my_field
>>> ap.owning_class
<class 'MyClass'>
>>> ap = MyClass.__mapper__.all_orm_descriptors['my_field']
>>> ap.owning_class
<class 'MyClass'>
</code></pre></div>
<p dir="auto">Without the owning_class set, most of the other properties will raise exceptions when trying to access them. This can be problematic when using the mapper class to procedurally access fields via the mapper.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/3423/rework_attribute_proxy_owner.patch">rework_attribute_proxy_owner.patch</a> | <a href="../wiki/imported_issue_attachments/3423/aptest.py">aptest.py</a></p> | 1 |
<p dir="auto">As far as I can tell, when <code class="notranslate">&str</code> appears as the return type of a function, this silently implies <code class="notranslate">&'static str</code>. I think this holds for all other types as well, not just <code class="notranslate">str</code>. I propose that we force people to be explicit here, since our general rule is that any borrowed pointer that is returned from a function must have an explicit lifetime.</p> | <p dir="auto">We currently have <code class="notranslate">Zero</code> and <code class="notranslate">One</code> traits that are meant to work with <code class="notranslate">Add</code> and <code class="notranslate">Mul</code> and support iterator operations like <code class="notranslate">sum</code>, as well as the current <code class="notranslate">step_by</code> API.</p>
<p dir="auto">It would be good to have a more comprehensive vision for this kind of trait before stabilization; an RFC would be ideal.</p> | 0 |
<p dir="auto">Thank you for submitting a TensorFlow documentation issue. Per our GitHub<br>
policy, we only address code/doc bugs, performance issues, feature requests, and<br>
build/installation issues on GitHub.</p>
<p dir="auto">The TensorFlow docs are open source! To get involved, read the documentation<br>
contributor guide: <a href="https://www.tensorflow.org/community/contribute/docs" rel="nofollow">https://www.tensorflow.org/community/contribute/docs</a></p>
<h2 dir="auto">URL(s) with the issue:</h2>
<p dir="auto">Please provide a link to the documentation entry, for example:<br>
<a href="https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/MyMethod" rel="nofollow">https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/MyMethod</a></p>
<h2 dir="auto">Description of issue (what needs changing):</h2>
<h3 dir="auto">Clear description</h3>
<p dir="auto">For example, why should someone use this method? How is it useful?</p>
<h3 dir="auto">Correct links</h3>
<p dir="auto">Is the link to the source code correct?</p>
<h3 dir="auto">Parameters defined</h3>
<p dir="auto">Are all parameters defined and formatted correctly?</p>
<h3 dir="auto">Returns defined</h3>
<p dir="auto">Are return values defined?</p>
<h3 dir="auto">Raises listed and defined</h3>
<p dir="auto">Are the errors defined? For example,<br>
<a href="https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/feature_column/categorical_column_with_vocabulary_file#raises" rel="nofollow">https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/feature_column/categorical_column_with_vocabulary_file#raises</a></p>
<h3 dir="auto">Usage example</h3>
<p dir="auto">Is there a usage example?</p>
<h3 dir="auto">Request visuals, if applicable</h3>
<p dir="auto">Are there currently visuals? If not, will it clarify the content?</p>
<h3 dir="auto">Submit a pull request?</h3>
<p dir="auto">Are you planning to also submit a pull request to fix the issue? See the docs<br>
contributor guide: <a href="https://www.tensorflow.org/community/contribute/docs" rel="nofollow">https://www.tensorflow.org/community/contribute/docs</a> and the<br>
docs style guide: <a href="https://www.tensorflow.org/community/contribute/docs_style" rel="nofollow">https://www.tensorflow.org/community/contribute/docs_style</a></p> | <p dir="auto">Thank you for submitting a TensorFlow documentation issue. Per our GitHub<br>
policy, we only address code/doc bugs, performance issues, feature requests, and<br>
build/installation issues on GitHub.</p>
<p dir="auto">The TensorFlow docs are open source! To get involved, read the documentation<br>
contributor guide: <a href="https://www.tensorflow.org/community/contribute/docs" rel="nofollow">https://www.tensorflow.org/community/contribute/docs</a></p>
<h2 dir="auto">URL(s) with the issue:</h2>
<p dir="auto">Please provide a link to the documentation entry, for example:<br>
<a href="https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/io/write_file" rel="nofollow">https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/io/write_file</a></p>
<h2 dir="auto">Description of issue (what needs changing):</h2>
<h3 dir="auto">Clear description</h3>
<p dir="auto">The description does not recommend at all in any way when and when not to use this symbol.</p>
<h3 dir="auto">Correct links</h3>
<p dir="auto">Yes</p>
<h3 dir="auto">Parameters defined</h3>
<p dir="auto">Yes</p>
<h3 dir="auto">Returns defined</h3>
<p dir="auto">Yes</p>
<h3 dir="auto">Raises listed and defined</h3>
<p dir="auto">The returned objects are not well defined and therefore not correct, complete and appropriately formatted</p>
<h3 dir="auto">Usage example</h3>
<p dir="auto">Yes</p>
<h3 dir="auto">Request visuals, if applicable</h3>
<p dir="auto">No single visual included in the symbol’s description. In some instances it will definitely clarify the content being presented.</p>
<h3 dir="auto">Submit a pull request?</h3>
<p dir="auto">Are you planning to also submit a pull request to fix the issue? See the docs<br>
contributor guide: <a href="https://www.tensorflow.org/community/contribute/docs" rel="nofollow">https://www.tensorflow.org/community/contribute/docs</a> and the<br>
docs style guide: <a href="https://www.tensorflow.org/community/contribute/docs_style" rel="nofollow">https://www.tensorflow.org/community/contribute/docs_style</a></p> | 1 |
<p dir="auto">Hello, I am Brazilian, and I can help make the English / Portuguese translation.<br>
Are countless users of the bootstrap in the country, and many do not know English.<br>
I am not of the best Portuguese / English.<br>
More English / Portuguese, know what to say!</p>
<p dir="auto">other languages can now be translated also release the Portuguese.<br>
thank you,</p> | 1 |
|
<pre class="notranslate">Go version:
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. go get github.com/kisielk/vigo
2. cd $GOPATH/github.com/kisielk/vigo
3. go build
4. ./vigo 2> trace
The stack trace is here:
unexpected fault address 0xc1c46c1668
fatal error: fault
[signal 0xb code=0x1 addr=0xc1c46c1668 pc=0x40c590]
goroutine 4 [running]:
[fp=0xc200059ed0] runtime.throw(0x596d97)
/home/kamil/go/src/pkg/runtime/panic.c:473 +0x67
[fp=0xc200059ee8] runtime.sigpanic()
/home/kamil/go/src/pkg/runtime/os_linux.c:239 +0xe7
[fp=0xc20005a288] scanblock(0x7f27611d9000, 0x7f27611d9048, 0x2, 0x1)
/home/kamil/go/src/pkg/runtime/mgc0.c:800 +0xa00
[fp=0xc20005a3b8] gc(0x7f27612e7e04)
/home/kamil/go/src/pkg/runtime/mgc0.c:2001 +0x2c5
----- stack segment boundary -----
[fp=0x7f27612e7e18] runtime.gc(0xc200000000)
/home/kamil/go/src/pkg/runtime/mgc0.c:1927 +0x11b
[fp=0x7f27612e7e70] runtime.mallocgc(0x80, 0x100000001, 0x1)
/home/kamil/go/src/pkg/runtime/zmalloc_linux_amd64.c:101 +0x1e4
[fp=0x7f27612e7ea8] makeslice1(0x4afc40, 0x80, 0x80, 0x7f27612e7ef0)
/home/kamil/go/src/pkg/runtime/slice.c:61 +0x89
[fp=0x7f27612e7ed8] runtime.makeslice(0x4afc40, 0x80, 0x80, 0x0, 0x80, ...)
/home/kamil/go/src/pkg/runtime/slice.c:34 +0x9a
[fp=0x7f27612e7fb8] github.com/nsf/termbox-go.func·001()
/home/kamil/src/github.com/nsf/termbox-go/api.go:84 +0x3e
[fp=0x7f27612e7fc0] runtime.goexit()
/home/kamil/go/src/pkg/runtime/proc.c:1223
created by github.com/nsf/termbox-go.Init
/home/kamil/src/github.com/nsf/termbox-go/api.go:101 +0x66f
goroutine 1 [chan receive]:
github.com/kisielk/vigo/editor.(*editor).Loop(0xc20009f000, 0xc2000472d0, 0x0)
/home/kamil/src/github.com/kisielk/vigo/editor/editor.go:435 +0x61
main.main()
/home/kamil/src/github.com/kisielk/vigo/main.go:26 +0x18c
goroutine 3 [syscall]:
os/signal.loop()
/home/kamil/go/src/pkg/os/signal/signal_unix.go:21 +0x1c
created by os/signal.init·1
/home/kamil/go/src/pkg/os/signal/signal_unix.go:27 +0x2f
goroutine 5 [runnable]:
main.func·001()
/home/kamil/src/github.com/kisielk/vigo/main.go:21
created by main.main
/home/kamil/src/github.com/kisielk/vigo/main.go:25 +0x179
The relevant part of termbox-go/api.go:
83 go func() {
84 buf := make([]byte, 128)
85 for {
86 select {
87 case <-sigio:
88 for {
89 n, err := syscall.Read(in, buf)
90 if err == syscall.EAGAIN || err == syscall.EWOULDBLOCK {
91 break
92 }
93 input_comm <- input_event{buf[:n], err}
94 ie := <-input_comm
95 buf = ie.data[:128]
96 }
97 case <-quit:
98 return
99 }
100 }
101 }()
The program depends on termbox-go, for which the code is at github.com/nsf/termbox-go
Note that it uses unsafe in a few places to make some syscalls to determine terminal
size.
There is no crash with GOGC=off. Also if I check out theprevious revision of the vigo
project, before I moved things from package main to a subpackage, there is no crash
either. The code runs fine when compiled with go1.0.2 on the same machine.
Sorry I couldn't provide a smaller test case at this point, but let me know if I can do
anything to narrow it down.
Which compiler are you using (5g, 6g, 8g, gccgo)?
8g
Which operating system are you using?
Ubuntu 12.10 64-bit, Mac OS X 10.8
Which version are you using? (run 'go version')
go version devel +0c16e97c7587 Thu Apr 25 13:23:24 2013 +0900 linux/amd64</pre> | <p dir="auto">by <strong>eduard.castany</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
go run hola.go
What is the expected output?
Hello, 世界
What do you see instead?
Hello, õ©ûþòî
Which compiler are you using (5g, 6g, 8g, gccgo)?
go.weekly.2012-03-13.windows-amd64.msi
Which operating system are you using?
windows 7 64</pre> | 0 |
<h2 dir="auto">Bug Report</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I would like to work on a fix!</li>
</ul>
<p dir="auto"><strong>Current behavior</strong><br>
A clear and concise description of the behavior.</p>
<ul dir="auto">
<li><a href="https://babeljs.io/repl#?browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=MYGwhgzhAEASCmIQHtrwB4Bd4DsAmMAwsgLYAOyOum0A3gFDTQDuyATiHtALzQAUASh4A-aAB5MACwCWEAHQB1dp2hlutKbLkA3AL7QA9MPq6gA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=unambiguous&lineWrap=false&presets=env&prettier=false&targets=&version=7.11.1&externalPlugins=%40babel%2Fplugin-proposal-class-properties%407.10.4%2C%40babel%2Fplugin-syntax-jsx%407.10.4%2C%40babel%2Fplugin-transform-classes%407.10.4" rel="nofollow">REPL</a></li>
</ul>
<p dir="auto"><strong>Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)</strong></p>
<ul dir="auto">
<li>Filename: <code class="notranslate">.babelrc</code></li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
plugins: [
["@babel/proposal-class-properties"],
["@babel/transform-classes"],
["@babel/plugin-syntax-jsx"]
]
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-kos">[</span><span class="pl-s">"@babel/proposal-class-properties"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s">"@babel/transform-classes"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-syntax-jsx"</span><span class="pl-kos">]</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Hello extends Component {
world = () => <this.World p={this.v} />
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Hello</span> <span class="pl-k">extends</span> <span class="pl-v">Component</span> <span class="pl-kos">{</span>
<span class="pl-c1">world</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-c1"><</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-v">World</span> <span class="pl-c1">p</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">v</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Output Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//...
var Hello = /*#__PURE__*/function (_Component) {
"use strict";
_inherits(Hello, _Component);
var _super = _createSuper(Hello);
function Hello() {
var _this2 = this;
var _this;
_classCallCheck(this, Hello);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "world", function () {
return <_this2.World p={_this.v} />;
});
return _this;
}
return Hello;
}(Component);
//..."><pre class="notranslate"><span class="pl-c">//...</span>
<span class="pl-k">var</span> <span class="pl-v">Hello</span> <span class="pl-c1">=</span> <span class="pl-c">/*#__PURE__*/</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">_Component</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-en">_inherits</span><span class="pl-kos">(</span><span class="pl-v">Hello</span><span class="pl-kos">,</span> <span class="pl-s1">_Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_super</span> <span class="pl-c1">=</span> <span class="pl-en">_createSuper</span><span class="pl-kos">(</span><span class="pl-v">Hello</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-v">Hello</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">_this2</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
<span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">Hello</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">args</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-s1">_this</span> <span class="pl-c1">=</span> <span class="pl-s1">_super</span><span class="pl-kos">.</span><span class="pl-c1">call</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">_super</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">args</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">_defineProperty</span><span class="pl-kos">(</span><span class="pl-en">_assertThisInitialized</span><span class="pl-kos">(</span><span class="pl-s1">_this</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">"world"</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1"><</span><span class="pl-s1">_this2</span><span class="pl-kos">.</span><span class="pl-v">World</span> <span class="pl-c1">p</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">v</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-v">Hello</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-v">Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//...</span></pre></div>
<p dir="auto"><strong>Expected behavior</strong><br>
A clear and concise description of what you expected to happen (or code).</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//...
var Hello = /*#__PURE__*/function (_Component) {
"use strict";
_inherits(Hello, _Component);
var _super = _createSuper(Hello);
function Hello() {
var _this;
_classCallCheck(this, Hello);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "world", function () {
return <_this.World p={_this.v} />;
});
return _this;
}
return Hello;
}(Component);
//..."><pre class="notranslate"><span class="pl-c">//...</span>
<span class="pl-k">var</span> <span class="pl-v">Hello</span> <span class="pl-c1">=</span> <span class="pl-c">/*#__PURE__*/</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">_Component</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-en">_inherits</span><span class="pl-kos">(</span><span class="pl-v">Hello</span><span class="pl-kos">,</span> <span class="pl-s1">_Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_super</span> <span class="pl-c1">=</span> <span class="pl-en">_createSuper</span><span class="pl-kos">(</span><span class="pl-v">Hello</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-v">Hello</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
<span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">Hello</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">args</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-s1">_this</span> <span class="pl-c1">=</span> <span class="pl-s1">_super</span><span class="pl-kos">.</span><span class="pl-c1">call</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">_super</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">args</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">_defineProperty</span><span class="pl-kos">(</span><span class="pl-en">_assertThisInitialized</span><span class="pl-kos">(</span><span class="pl-s1">_this</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">"world"</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1"><</span><span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-v">World</span> <span class="pl-c1">p</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">v</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-v">Hello</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-v">Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//...</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" System:
OS: macOS 11.0
Binaries:
Node: 14.7.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
npmPackages:
@babel/core: 7.11.1 => 7.11.1
@babel/plugin-proposal-class-properties: 7.10.4 => 7.10.4
@babel/plugin-syntax-jsx: 7.10.4 => 7.10.4
@babel/plugin-transform-classes: 7.10.4 => 7.10.4"><pre class="notranslate"><code class="notranslate"> System:
OS: macOS 11.0
Binaries:
Node: 14.7.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
npmPackages:
@babel/core: 7.11.1 => 7.11.1
@babel/plugin-proposal-class-properties: 7.10.4 => 7.10.4
@babel/plugin-syntax-jsx: 7.10.4 => 7.10.4
@babel/plugin-transform-classes: 7.10.4 => 7.10.4
</code></pre></div>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto">This patch won't be correct, but work for the snippet above:</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--- transformClass.js 2020-08-11 21:49:04.000000000 +0800
+++ transformClass.patch.js 2020-08-11 21:55:10.000000000 +0800
@@ -54,6 +54,7 @@
staticPropBody: [],
body: [],
superThises: [],
+ jsxSuperThises: [],
pushedConstructor: false,
pushedInherits: false,
protoAlias: null,
@@ -75,6 +76,9 @@
ThisExpression(path) {
classState.superThises.push(path);
},
+ JSXIdentifier(path) {
+ if (path.node.name === 'this') classState.jsxSuperThises.push(path);
+ },
},
]);
@@ -339,6 +343,15 @@
);
}
+ for (const thisPath of classState.jsxSuperThises) {
+ const { node, parentPath } = thisPath;
+ if (parentPath.isJSXMemberExpression({ object: node })) {
+ const ref = thisRef();
+ ref.type = "JSXIdentifier";
+ thisPath.replaceWith(thisRef());
+ }
+ }
+
const bareSupers = new Set();
path.traverse(
traverse.visitors.merge(["><pre class="notranslate"><span class="pl-md">--- transformClass.js 2020-08-11 21:49:04.000000000 +0800</span>
<span class="pl-mi1">+++ transformClass.patch.js 2020-08-11 21:55:10.000000000 +0800</span>
<span class="pl-mdr">@@ -54,6 +54,7 @@</span>
staticPropBody: [],
body: [],
superThises: [],
<span class="pl-mi1"><span class="pl-mi1">+</span> jsxSuperThises: [],</span>
pushedConstructor: false,
pushedInherits: false,
protoAlias: null,
<span class="pl-mdr">@@ -75,6 +76,9 @@</span>
ThisExpression(path) {
classState.superThises.push(path);
},
<span class="pl-mi1"><span class="pl-mi1">+</span> JSXIdentifier(path) {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> if (path.node.name === 'this') classState.jsxSuperThises.push(path);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> },</span>
},
]);
<span class="pl-mdr">@@ -339,6 +343,15 @@</span>
);
}
<span class="pl-mi1"><span class="pl-mi1">+</span> for (const thisPath of classState.jsxSuperThises) {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> const { node, parentPath } = thisPath;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> if (parentPath.isJSXMemberExpression({ object: node })) {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> const ref = thisRef();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> ref.type = "JSXIdentifier";</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> thisPath.replaceWith(thisRef());</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> }</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> }</span>
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
const bareSupers = new Set();
path.traverse(
traverse.visitors.merge([</pre></div>
<p dir="auto"><strong>Additional context</strong><br>
Add any other context about the problem here. Or a screenshot if applicable</p> | <h2 dir="auto">Bug Report</h2>
<p dir="auto">I (and others) get an error when running the build of a create-react-app project ("Minified React error <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="48196010" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/130" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/130/hovercard" href="https://github.com/babel/babel/pull/130">#130</a> - 'this' in JSX arrow function", see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="589365999" data-permission-text="Title is private" data-url="https://github.com/facebook/create-react-app/issues/8738" data-hovercard-type="issue" data-hovercard-url="/facebook/create-react-app/issues/8738/hovercard" href="https://github.com/facebook/create-react-app/issues/8738">facebook/create-react-app#8738</a></p>
<p dir="auto"><em>Note: I had hoped to find a existing bug, so I <a href="https://github.com/babel/babel/discussions/11785" data-hovercard-type="discussion" data-hovercard-url="/babel/babel/discussions/11785/hovercard">posted the problem as a discussion</a> first</em></p>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">With the following code</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class ComponentWithJsx extends React.Component {
First = () => <this.Second />; // <- problem
Second = () => <div>SUCCESS (ComponentWithJsx)</div>;
render() {
return <this.First />;
}
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">ComponentWithJsx</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
<span class="pl-c1">First</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-c1"><</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-v">Second</span> <span class="pl-c1">/</span><span class="pl-c1">></span><span class="pl-kos">;</span> <span class="pl-c">// <- problem</span>
<span class="pl-c1">Second</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-c1"><</span><span class="pl-ent">div</span><span class="pl-c1">></span>SUCCESS (ComponentWithJsx)<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1"><</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-v">First</span> <span class="pl-c1">/</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I get this error:</p>
<blockquote>
<p dir="auto">Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.<br>
in Unknown (created by ComponentWithJsx)<br>
in ComponentWithJsx</p>
</blockquote>
<p dir="auto">I built a minimal, reproducible example by ejecting create-react-app and reducing it to the minimal code which triggers the behavior: <a href="https://github.com/sbusch/create-react-app-8738-repro">https://github.com/sbusch/create-react-app-8738-repro</a></p>
<p dir="auto">Based on this, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JLHwung/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JLHwung">@JLHwung</a> created an <a href="https://babeljs.io/en/repl#?browsers=defaults&build=&builtIns=false&spec=false&loose=false&code_lz=JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wG4AoctAGxQGc64BBMMOJADxiQDsATRsnQwAdAGFckHr3gBvSnDgAjKHAC8cAEQrNFcoqL8kqjQAoAlOoB8cefsVwiMAK5QecU_YdwAPDAAWwHQiKnAA9FZecOYUigC-FHGUnJCwcHxImCjO1PAsYKRAA&debug=false&forceAllTransforms=false&shippedProposals=true&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=env%2Creact%2Cenv&prettier=false&targets=&version=7.10.4&externalPlugins=" rel="nofollow">REPL</a> (thank you!)</p>
<p dir="auto">More info in the <code class="notranslate">README.md</code> in the <a href="https://github.com/sbusch/create-react-app-8738-repro">repro</a> and in my comment to the original issue here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="589365999" data-permission-text="Title is private" data-url="https://github.com/facebook/create-react-app/issues/8738" data-hovercard-type="issue" data-hovercard-url="/facebook/create-react-app/issues/8738/hovercard?comment_id=646198606&comment_type=issue_comment" href="https://github.com/facebook/create-react-app/issues/8738#issuecomment-646198606">facebook/create-react-app#8738 (comment)</a></p>
<p dir="auto">The problem is ultimately caused by the Babel plugin <code class="notranslate">@babel/plugin-transform-classes</code>, but it's only happening in conjunction with <code class="notranslate">@babel/plugin-transform-react-jsx</code> and <code class="notranslate">@babel/plugin-proposal-class-properties</code>.</p>
<p dir="auto">Tested with newest versions of <code class="notranslate">@babel/core</code> and mentioned packages (see <a href="https://github.com/sbusch/create-react-app-8738-repro/blob/master/package.json"><code class="notranslate">package.json</code> in the repro</a>)</p>
<p dir="auto"><em>Note: I can work around the problem by disabling <code class="notranslate">@babel/plugin-transform-classes</code> or by settting the <code class="notranslate">@babel/plugin-transform-classes</code> option <code class="notranslate">{ loose: true}</code> (or - in a create-react-app project - by limiting the <code class="notranslate">browserslist</code> for <code class="notranslate">@babel/preset-env</code> to browsers which don't need the <code class="notranslate">@babel/plugin-transform-classes</code> transform. For the default <code class="notranslate">browserslist</code>, this can be achieved by adding <code class="notranslate">not ie 11</code>)</em></p>
<p dir="auto"><strong>Input Code</strong></p>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JLHwung/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JLHwung">@JLHwung</a> <a href="https://babeljs.io/en/repl#?browsers=defaults&build=&builtIns=false&spec=false&loose=false&code_lz=JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wG4AoctAGxQGc64BBMMOJADxiQDsATRsnQwAdAGFckHr3gBvSnDgAjKHAC8cAEQrNFcoqL8kqjQAoAlOoB8cefsVwiMAK5QecU_YdwAPDAAWwHQiKnAA9FZecOYUigC-FHGUnJCwcHxImCjO1PAsYKRAA&debug=false&forceAllTransforms=false&shippedProposals=true&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=env%2Creact%2Cenv&prettier=false&targets=&version=7.10.4&externalPlugins=" rel="nofollow">REPL</a>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import React from 'react';
class App extends React.Component {
br = "br";
render = () => {
return (
<this.br />
);
};
}
export default App;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>
<span class="pl-k">class</span> <span class="pl-v">App</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
<span class="pl-c1">br</span> <span class="pl-c1">=</span> <span class="pl-s">"br"</span><span class="pl-kos">;</span>
<span class="pl-c1">render</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-s1">br</span> <span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-v">App</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">No runtime errors should occur. Currently, the value for <code class="notranslate">this</code> is somehow lost.</p>
<p dir="auto">When building and serving the <a href="https://github.com/sbusch/create-react-app-8738-repro">repro</a>, I expect rendering of</p>
<blockquote>
<p dir="auto">SUCCESS (ComponentWithoutJsx) and<br>
SUCCESS (ComponentWithJsx)</p>
</blockquote>
<p dir="auto">(as outline in thw README.md there)</p>
<p dir="auto"><strong>Babel Configuration</strong></p>
<p dir="auto">Excerpt from <code class="notranslate">webpack.config.js</code> (full file here: <a href="https://github.com/sbusch/create-react-app-8738-repro/blob/master/webpack.config.js">https://github.com/sbusch/create-react-app-8738-repro/blob/master/webpack.config.js</a>):</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
test: /\.(js|jsx)$/,
include: srcPath,
loader: require.resolve("babel-loader"),
options: {
plugins: [
//*
[
"@babel/plugin-transform-react-jsx",
{
// Rule out that PURE markers are the culprit
pure: false,
},
],
//*/
//*
[
"@babel/plugin-proposal-class-properties",
{
// Enable loose mode to use assignment instead of defineProperty
// See discussion in https://github.com/facebook/create-react-app/issues/4263
loose: true,
},
],
//*/
//*
[
"@babel/plugin-transform-classes",
{
loose: false,
},
],
//*/
],
},
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>js<span class="pl-c1">|</span>jsx<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">include</span>: <span class="pl-s1">srcPath</span><span class="pl-kos">,</span>
<span class="pl-c1">loader</span>: <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">"babel-loader"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">options</span>: <span class="pl-kos">{</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-c">//*</span>
<span class="pl-kos">[</span>
<span class="pl-s">"@babel/plugin-transform-react-jsx"</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c">// Rule out that PURE markers are the culprit</span>
<span class="pl-c1">pure</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c">//*/</span>
<span class="pl-c">//*</span>
<span class="pl-kos">[</span>
<span class="pl-s">"@babel/plugin-proposal-class-properties"</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c">// Enable loose mode to use assignment instead of defineProperty</span>
<span class="pl-c">// See discussion in https://github.com/facebook/create-react-app/issues/4263</span>
<span class="pl-c1">loose</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c">//*/</span>
<span class="pl-c">//*</span>
<span class="pl-kos">[</span>
<span class="pl-s">"@babel/plugin-transform-classes"</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">loose</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c">//*/</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" System:
OS: macOS 10.15.5
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
@babel/core: 7.10.4 => 7.10.4
@babel/plugin-proposal-class-properties: ^7.10.4 => 7.10.4
@babel/plugin-transform-classes: 7.10.4 => 7.10.4
@babel/plugin-transform-react-jsx: 7.10.4 => 7.10.4
babel-loader: 8.1.0 => 8.1.0
webpack: 4.43.0 => 4.43.0"><pre class="notranslate"><code class="notranslate"> System:
OS: macOS 10.15.5
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
@babel/core: 7.10.4 => 7.10.4
@babel/plugin-proposal-class-properties: ^7.10.4 => 7.10.4
@babel/plugin-transform-classes: 7.10.4 => 7.10.4
@babel/plugin-transform-react-jsx: 7.10.4 => 7.10.4
babel-loader: 8.1.0 => 8.1.0
webpack: 4.43.0 => 4.43.0
</code></pre></div>
<ul dir="auto">
<li>Monorepo: no</li>
<li>How you are using Babel: <code class="notranslate">loader</code></li>
</ul>
<hr>
<p dir="auto">Thanks to all contributors for creating Babel!</p> | 1 |
<p dir="auto">Hi all, I am new to react and I am trying to create a react library of components and I came across this problem because one of the components I am creating uses <a href="https://reactjs.org/docs/hooks-intro.html" rel="nofollow">REACT HOOKS</a>.</p>
<p dir="auto"><strong>Disclaimer: this is my first time creating an issue, so please bear with me.</strong></p>
<p dir="auto">So I am trying to create an accordion component which toggles between these classes <code class="notranslate">accordion__item--open</code> and <code class="notranslate">accordion__item</code> to open and close.</p>
<p dir="auto"><strong>package.json</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"name": "react-lib",
"version": "0.3.0",
"description": "A simple UI library of react components",
"main": "dist/index.js",
"publishConfig": {
"registry": ""
},
"scripts": {
"login": "",
"build": "webpack --mode=production",
"develop": "webpack --mode=development --watch"
},
"repository": {
"type": "git",
"url": ""
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "",
"dependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.5",
"eslint": "^5.15.1",
"eslint-loader": "^2.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-node-externals": "^1.7.2"
},
"devDependencies": {
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0"
}
}"><pre class="notranslate"><code class="notranslate">{
"name": "react-lib",
"version": "0.3.0",
"description": "A simple UI library of react components",
"main": "dist/index.js",
"publishConfig": {
"registry": ""
},
"scripts": {
"login": "",
"build": "webpack --mode=production",
"develop": "webpack --mode=development --watch"
},
"repository": {
"type": "git",
"url": ""
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "",
"dependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.5",
"eslint": "^5.15.1",
"eslint-loader": "^2.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-node-externals": "^1.7.2"
},
"devDependencies": {
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0"
}
}
</code></pre></div>
<p dir="auto"><strong>webpack.config.js</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'development',
optimization: {
minimize: true,
},
entry: './index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'index.js',
library: '',
libraryTarget: 'commonjs'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/react']
}
}
]
}
};"><pre class="notranslate"><code class="notranslate">const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'development',
optimization: {
minimize: true,
},
entry: './index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'index.js',
library: '',
libraryTarget: 'commonjs'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/react']
}
}
]
}
};
</code></pre></div>
<p dir="auto"><strong>This is the accordion container:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React from 'react';
function Accordion({ children }) {
return (
<div className="accordion">
{ children }
</div>
);
}
export default Accordion;
"><pre class="notranslate"><code class="notranslate">import React from 'react';
function Accordion({ children }) {
return (
<div className="accordion">
{ children }
</div>
);
}
export default Accordion;
</code></pre></div>
<p dir="auto"><strong>This is the accordion item that will live inside the container:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React, { useState } from 'react';
function AccordionItem({header, content}) {
const [ isActive, toggleActive ] = useState(false);
return (
<div className={ `accordion__item ${ isActive ? 'accordion__item--open' : '' }` }>
<button
className="accordion__item-header"
onClick={ () => isActive ? toggleActive(false) : toggleActive(true) }
>
{ header }
<svg className="icon icon--debit" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<path className="icon__path" d="M22.37,22.33V2.67a2.63,2.63,0,0,1,5.26,0V47.24a2.63,2.63,0,0,1-5.26.09V27.58H2.71a2.63,2.63,0,0,1,0-5.25Zm11.92,5.25a2.63,2.63,0,0,1,0-5.25h13a2.63,2.63,0,0,1,0,5.25Z">
</path>
</svg>
</button>
<div className="accordion__item-content">
{ children }
</div>
</div>
)
};
export default AccordionItem;
"><pre class="notranslate"><code class="notranslate">import React, { useState } from 'react';
function AccordionItem({header, content}) {
const [ isActive, toggleActive ] = useState(false);
return (
<div className={ `accordion__item ${ isActive ? 'accordion__item--open' : '' }` }>
<button
className="accordion__item-header"
onClick={ () => isActive ? toggleActive(false) : toggleActive(true) }
>
{ header }
<svg className="icon icon--debit" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<path className="icon__path" d="M22.37,22.33V2.67a2.63,2.63,0,0,1,5.26,0V47.24a2.63,2.63,0,0,1-5.26.09V27.58H2.71a2.63,2.63,0,0,1,0-5.25Zm11.92,5.25a2.63,2.63,0,0,1,0-5.25h13a2.63,2.63,0,0,1,0,5.25Z">
</path>
</svg>
</button>
<div className="accordion__item-content">
{ children }
</div>
</div>
)
};
export default AccordionItem;
</code></pre></div>
<p dir="auto">Now inside of a <a href="https://github.com/sethandleah/myapp">create-react-app</a> I import these components</p>
<p dir="auto">My <a href="https://github.com/sethandleah/react-lib">library</a> and the <a href="https://github.com/sethandleah/myapp">create-react-app</a> are relative to each other and I am using <code class="notranslate">npm link</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React from 'react';
import {AccordionItem} from 'react-lib'
import {Accordion} from 'react-lib';
function App ({props}) {
return (
<Accordion>
<AccordionItem header={"Hello"} content={"World"}/>
</Accordion>
)
}
export default App;"><pre class="notranslate"><code class="notranslate">import React from 'react';
import {AccordionItem} from 'react-lib'
import {Accordion} from 'react-lib';
function App ({props}) {
return (
<Accordion>
<AccordionItem header={"Hello"} content={"World"}/>
</Accordion>
)
}
export default App;
</code></pre></div>
<p dir="auto">I have followed all of these <a href="https://reactjs.org/warnings/invalid-hook-call-warning.html" rel="nofollow">instructions</a> and I still get the same error.</p>
<p dir="auto"><strong>Current behavior?</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."><pre class="notranslate"><code class="notranslate">Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
</code></pre></div>
<p dir="auto"><strong>Steps to reproduce</strong></p>
<ul dir="auto">
<li>clone <a href="https://github.com/sethandleah/react-lib">https://github.com/sethandleah/react-lib</a></li>
<li>clone <a href="https://github.com/sethandleah/myapp">https://github.com/sethandleah/myapp</a></li>
<li><code class="notranslate">cd react-lib</code></li>
<li><code class="notranslate">npm install</code></li>
<li><code class="notranslate">npm link</code></li>
<li><code class="notranslate">cd ../myapp</code></li>
<li><code class="notranslate">npm i</code></li>
<li><code class="notranslate">npm link react-lib</code></li>
<li><code class="notranslate">npm start</code></li>
</ul>
<p dir="auto"><strong>Expected behavior</strong></p>
<ul dir="auto">
<li>It should show a button with a "plus" svg sign and the words "Hello" and "World" respectively</li>
<li>Open devtools and go to elements</li>
<li>When clicking on the button the class <code class="notranslate">accordion_item--open</code> should toggle</li>
</ul>
<p dir="auto"><strong>To see the above, do the following:</strong></p>
<ul dir="auto">
<li>Uncomment these lines at <code class="notranslate">myapp/src/App.js</code></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import Accordion from './Accordion';
import AccordionItem from './AccordionItem';"><pre class="notranslate"><code class="notranslate">import Accordion from './Accordion';
import AccordionItem from './AccordionItem';
</code></pre></div>
<ul dir="auto">
<li>The comment out these line, alse at <code class="notranslate">myapp/src/App.js</code>:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Accordion } from 'react-lib';
import { AccordionItem } from 'react-lib';"><pre class="notranslate"><code class="notranslate">import { Accordion } from 'react-lib';
import { AccordionItem } from 'react-lib';
</code></pre></div>
<p dir="auto"><strong>Versions of React, Browser / OS are affected by this issue:</strong></p>
<ul dir="auto">
<li>React and React-Dom: both are <code class="notranslate">^16.8.6</code> on both <a href="https://github.com/sethandleah/react-lib">react-lib</a> and the <a href="https://github.com/sethandleah/myapp">myapp</a></li>
<li>Browser: Brave <code class="notranslate">Version 0.61.52 Chromium: 73.0.3683.86 (Official Build) (64-bit)</code></li>
<li>OS: MacOS High Siera <code class="notranslate"> Version 10.13.6 (17G5019)</code></li>
</ul> | <p dir="auto">on the MDN site <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code</a></p>
<p dir="auto">Mozilla is saying Event.code is the new way to distinguish which button a user is pressing, having to pull this off of the native event is a pain, and since this is the new standard, it'd be nice to have it on React's synthetic events.</p> | 0 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.5.2681.0
Any other software? No"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.5.2681.0
Any other software? No
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Set the <code class="notranslate">newTabProfile0</code> shortcut to <code class="notranslate">"Ctrl+numpad_1"</code> and save:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"command" : "newTabProfile0",
"keys" :
[
"ctrl+numpad_1"
]
},"><pre class="notranslate"><code class="notranslate">{
"command" : "newTabProfile0",
"keys" :
[
"ctrl+numpad_1"
]
},
</code></pre></div>
<p dir="auto">Test the shortcut to verify that it works as expected (a new terminal tab opens as expected, regardless of which shell was currently active before).</p>
<p dir="auto">Reopen settings; change this shortcut to <code class="notranslate">"ctrl+shift+numpad_1"</code> and save. Try to use shortcut.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">A new terminal tab to be opened with the appropriate profile:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6520659/65925248-53171f00-e433-11e9-9a9a-bb84c1579a3b.png"><img src="https://user-images.githubusercontent.com/6520659/65925248-53171f00-e433-11e9-9a9a-bb84c1579a3b.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Depends on the currently active shell. If it's Powershell or cmd, nothing. If it's Bash WSL, <code class="notranslate">";5F"</code> appears following the prompt:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6520659/65925294-8fe31600-e433-11e9-8d04-36b3520ea05f.png"><img src="https://user-images.githubusercontent.com/6520659/65925294-8fe31600-e433-11e9-8d04-36b3520ea05f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">(Found this issue while testing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="487744935" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/2628" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/2628/hovercard" href="https://github.com/microsoft/terminal/issues/2628">#2628</a>; nto sure if it's also related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="499899118" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/2967" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/2967/hovercard" href="https://github.com/microsoft/terminal/issues/2967">#2967</a> or if I'm just incorrectly stating the shortcut?)</p> | <p dir="auto">Is it possible to focus terminal by hotkey? E.g. when I click ctrl + ` it should open/focus terminal and put in in foreground.</p> | 0 |
<p dir="auto"><strong>Elasticsearch version</strong>: 2.3.3</p>
<p dir="auto"><strong>JVM version</strong>:1.8.0_101</p>
<p dir="auto"><strong>OS version</strong>: Ubuntu 14.0.4</p>
<p dir="auto"><strong>Description of the problem including expected versus actual behavior</strong>:</p>
<p dir="auto"><strong>Steps to reproduce</strong>:</p>
<p dir="auto">Adding documents with two different location formats:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PUT /foo
{
"mappings": {
"bar": {
"properties": {
"location": {
"type": "geo_point",
"lat_lon":true
}
}
}
}
}
PUT /foo/bar/1
{
"location": "42,72"
}
PUT /foo/bar/2
{
"location": {
"lat": 41,
"lon": 71
}
}"><pre class="notranslate"><code class="notranslate">PUT /foo
{
"mappings": {
"bar": {
"properties": {
"location": {
"type": "geo_point",
"lat_lon":true
}
}
}
}
}
PUT /foo/bar/1
{
"location": "42,72"
}
PUT /foo/bar/2
{
"location": {
"lat": 41,
"lon": 71
}
}
</code></pre></div>
<p dir="auto">And searching wanting to output the sub-fields <code class="notranslate">lat</code> and <code class="notranslate">lon</code> which should be created as a result of setting <code class="notranslate">"lat_lon": true</code> in the mapping:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="GET /foo/bar/_search
{
"fields": [ "location.lat", "location.lon" ]
}"><pre class="notranslate"><code class="notranslate">GET /foo/bar/_search
{
"fields": [ "location.lat", "location.lon" ]
}
</code></pre></div>
<p dir="auto">returns</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" "hits": [
{
"_index": "foo",
"_type": "bar",
"_id": "2",
"_score": 1,
"fields": {
"location.lat": [
41
],
"location.lon": [
71
]
}
},
{
"_index": "foo",
"_type": "bar",
"_id": "1",
"_score": 1,
"fields": {
"location.lat": [
"42,72"
],
"location.lon": [
"42,72"
]
}
}"><pre class="notranslate"><code class="notranslate"> "hits": [
{
"_index": "foo",
"_type": "bar",
"_id": "2",
"_score": 1,
"fields": {
"location.lat": [
41
],
"location.lon": [
71
]
}
},
{
"_index": "foo",
"_type": "bar",
"_id": "1",
"_score": 1,
"fields": {
"location.lat": [
"42,72"
],
"location.lon": [
"42,72"
]
}
}
</code></pre></div>
<p dir="auto">Where we see that in document <em>2</em> the fields are correct, but in document <em>1</em> both lat and lon fields are the full original string.</p>
<p dir="auto">Have I misunderstood <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/lat-lon.html" rel="nofollow">the documentation</a> or is this a bug?</p>
<blockquote>
<p dir="auto">Setting lat_lon to true causes the latitude and longitude values to be indexed as numeric fields (called .lat and .lon).</p>
</blockquote> | <p dir="auto">Hi,</p>
<p dir="auto">I've recently upgraded ES from version 1.4.4 to 1.7.1 and now I have an issue with lat and lon indexed fields for geo_point.<br>
In my index I have a field defined as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""geolocation": {
"lat_lon": true,
"geohash_prefix": true,
"type": "geo_point",
"geohash": true
}"><pre class="notranslate"><code class="notranslate">"geolocation": {
"lat_lon": true,
"geohash_prefix": true,
"type": "geo_point",
"geohash": true
}
</code></pre></div>
<p dir="auto">When issuing the query</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"fields":["geolocation.lat","geolocation.lon","geolocation"],
"query": {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "20km",
"geolocation" : {
"lat" : 37.9174,
"lon" : -122.3050
}
}
}
}
}
}"><pre class="notranslate"><code class="notranslate">{
"fields":["geolocation.lat","geolocation.lon","geolocation"],
"query": {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "20km",
"geolocation" : {
"lat" : 37.9174,
"lon" : -122.3050
}
}
}
}
}
}
</code></pre></div>
<p dir="auto">this is the response</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""hits": {
"total": 3995,
"max_score": 1,
"hits": [
{
"_index": "idx",
"_type": "event",
"_id": "466201666890120",
"_score": 1,
"fields": {
"geolocation": [
"37.768991279975,-122.41938924477"
],
"geolocation.lon": [
"37.768991279975,-122.41938924477"
],
"geolocation.lat": [
"37.768991279975,-122.41938924477"
]
}
}"><pre class="notranslate"><code class="notranslate">"hits": {
"total": 3995,
"max_score": 1,
"hits": [
{
"_index": "idx",
"_type": "event",
"_id": "466201666890120",
"_score": 1,
"fields": {
"geolocation": [
"37.768991279975,-122.41938924477"
],
"geolocation.lon": [
"37.768991279975,-122.41938924477"
],
"geolocation.lat": [
"37.768991279975,-122.41938924477"
]
}
}
</code></pre></div>
<p dir="auto">In other words geolocation.lat and geolocation.lon contain the pair and not just the single value.<br>
Version 1.4.4 worked properly as expected.</p> | 1 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">When indexing into a tensor with another tensor, around 10 times the size of the array is used in memory on the GPU.</p>
<h2 dir="auto">To Reproduce</h2>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torch
def torch_memory(device):
# Checks and prints GPU memory
print(f'{torch.cuda.memory_allocated(device)/1024/1024:.2f} MB USED')
print(f'{torch.cuda.memory_reserved(device)/1024/1024:.2f} MB RESERVED')
print(f'{torch.cuda.max_memory_allocated(device)/1024/1024:.2f} MB USED MAX')
print(f'{torch.cuda.max_memory_reserved(device)/1024/1024:.2f} MB RESERVED MAX')
print('')
device = torch.device(0)
a = torch.randn((1, 32, 24, 512, 512), dtype=torch.float32, device=device) # 768 MB tensor
torch_memory(device)
indices = a < 0 # 192 MB tensor
torch_memory(device)
a[indices] = 0. # Allocates 10 times of 768 MB
torch_memory(device)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torch</span>
<span class="pl-k">def</span> <span class="pl-en">torch_memory</span>(<span class="pl-s1">device</span>):
<span class="pl-c"># Checks and prints GPU memory</span>
<span class="pl-en">print</span>(<span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">memory_allocated</span>(<span class="pl-s1">device</span>)<span class="pl-c1">/</span><span class="pl-c1">1024</span><span class="pl-c1">/</span><span class="pl-c1">1024</span>:.2f<span class="pl-kos">}</span></span> MB USED'</span>)
<span class="pl-en">print</span>(<span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">memory_reserved</span>(<span class="pl-s1">device</span>)<span class="pl-c1">/</span><span class="pl-c1">1024</span><span class="pl-c1">/</span><span class="pl-c1">1024</span>:.2f<span class="pl-kos">}</span></span> MB RESERVED'</span>)
<span class="pl-en">print</span>(<span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">max_memory_allocated</span>(<span class="pl-s1">device</span>)<span class="pl-c1">/</span><span class="pl-c1">1024</span><span class="pl-c1">/</span><span class="pl-c1">1024</span>:.2f<span class="pl-kos">}</span></span> MB USED MAX'</span>)
<span class="pl-en">print</span>(<span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">max_memory_reserved</span>(<span class="pl-s1">device</span>)<span class="pl-c1">/</span><span class="pl-c1">1024</span><span class="pl-c1">/</span><span class="pl-c1">1024</span>:.2f<span class="pl-kos">}</span></span> MB RESERVED MAX'</span>)
<span class="pl-en">print</span>(<span class="pl-s">''</span>)
<span class="pl-s1">device</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">device</span>(<span class="pl-c1">0</span>)
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">randn</span>((<span class="pl-c1">1</span>, <span class="pl-c1">32</span>, <span class="pl-c1">24</span>, <span class="pl-c1">512</span>, <span class="pl-c1">512</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">torch</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">device</span><span class="pl-c1">=</span><span class="pl-s1">device</span>) <span class="pl-c"># 768 MB tensor</span>
<span class="pl-en">torch_memory</span>(<span class="pl-s1">device</span>)
<span class="pl-s1">indices</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span> <span class="pl-c1"><</span> <span class="pl-c1">0</span> <span class="pl-c"># 192 MB tensor</span>
<span class="pl-en">torch_memory</span>(<span class="pl-s1">device</span>)
<span class="pl-s1">a</span>[<span class="pl-s1">indices</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.</span> <span class="pl-c"># Allocates 10 times of 768 MB</span>
<span class="pl-en">torch_memory</span>(<span class="pl-s1">device</span>)</pre></div>
<p dir="auto">This is the output that I get.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="768.00 MB USED
768.00 MB RESERVED
768.00 MB USED MAX
768.00 MB RESERVED MAX
960.00 MB USED
960.00 MB RESERVED
960.00 MB USED MAX
960.00 MB RESERVED MAX
960.00 MB USED
8662.00 MB RESERVED
8643.00 MB USED MAX
8662.00 MB RESERVED MAX"><pre class="notranslate"><code class="notranslate">768.00 MB USED
768.00 MB RESERVED
768.00 MB USED MAX
768.00 MB RESERVED MAX
960.00 MB USED
960.00 MB RESERVED
960.00 MB USED MAX
960.00 MB RESERVED MAX
960.00 MB USED
8662.00 MB RESERVED
8643.00 MB USED MAX
8662.00 MB RESERVED MAX
</code></pre></div>
<p dir="auto">The same thing happens when I use (supposed to be equivalent)</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a.index_put_((indices,), torch.tensor([0.]).to(device))"><pre class="notranslate"><span class="pl-s1">a</span>.<span class="pl-en">index_put_</span>((<span class="pl-s1">indices</span>,), <span class="pl-s1">torch</span>.<span class="pl-en">tensor</span>([<span class="pl-c1">0.</span>]).<span class="pl-en">to</span>(<span class="pl-s1">device</span>))</pre></div>
<p dir="auto">and even when I just index into the array without assigning new values to it, a lot of memory is used.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a[indices]"><pre class="notranslate"><span class="pl-s1">a</span>[<span class="pl-s1">indices</span>]</pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">I'm not sure how much memory indexing/assignment like this is supposed to use, but surely not 10 times.</p>
<p dir="auto">I tried this with CuPy arrays and they use 2-3 times the size of the array in memory.</p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): 1.1, 1.4, 1.5</li>
<li>OS (e.g., Linux): Linux</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): conda</li>
<li>Build command you used (if compiling from source): N/A</li>
<li>Python version: 3.7</li>
<li>CUDA/cuDNN version: 10.1, 7.6</li>
<li>GPU models and configuration: V100</li>
<li>Any other relevant information: N/A</li>
</ul> | <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: x = torch.randn(20000, 20000,device='cuda')
In [2]: torch.cuda.max_memory_allocated()
Out[2]: 1600126976
In [3]: m = ~torch.eye(20000, dtype=torch.bool, device='cuda')
In [4]: torch.cuda.max_memory_allocated()
Out[4]: 2401239040
In [5]: x[m]
Out[5]:
tensor([ 0.6415, 0.2951, -0.7630, ..., 1.0940, 0.3103, 0.3631],
device='cuda:0')
In [6]: torch.cuda.max_memory_allocated()
Out[6]: 10001317888
In [7]: torch.__version__
Out[7]: '1.4.0a0+91c6d2e'"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-en">randn</span>(<span class="pl-c1">20000</span>, <span class="pl-c1">20000</span>,<span class="pl-s1">device</span><span class="pl-c1">=</span><span class="pl-s">'cuda'</span>)
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">max_memory_allocated</span>()
<span class="pl-v">Out</span>[<span class="pl-c1">2</span>]: <span class="pl-c1">1600126976</span>
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-c1">~</span><span class="pl-s1">torch</span>.<span class="pl-en">eye</span>(<span class="pl-c1">20000</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">torch</span>.<span class="pl-s1">bool</span>, <span class="pl-s1">device</span><span class="pl-c1">=</span><span class="pl-s">'cuda'</span>)
<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">max_memory_allocated</span>()
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-c1">2401239040</span>
<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">x</span>[<span class="pl-s1">m</span>]
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]:
<span class="pl-en">tensor</span>([ <span class="pl-c1">0.6415</span>, <span class="pl-c1">0.2951</span>, <span class="pl-c1">-</span><span class="pl-c1">0.7630</span>, ..., <span class="pl-c1">1.0940</span>, <span class="pl-c1">0.3103</span>, <span class="pl-c1">0.3631</span>],
<span class="pl-s1">device</span><span class="pl-c1">=</span><span class="pl-s">'cuda:0'</span>)
<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">torch</span>.<span class="pl-s1">cuda</span>.<span class="pl-en">max_memory_allocated</span>()
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: <span class="pl-c1">10001317888</span>
<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">torch</span>.<span class="pl-s1">__version__</span>
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]: <span class="pl-s">'1.4.0a0+91c6d2e'</span></pre></div>
<p dir="auto">Titan XP<br>
CUDA: 10.1</p>
<p dir="auto">Why does it allocate about 4.75x of the indexed tensor, rather than just 1x?</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ngimel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ngimel">@ngimel</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/VitalyFedyunin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/VitalyFedyunin">@VitalyFedyunin</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mruberry/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mruberry">@mruberry</a></p> | 1 |
<ul dir="auto">
<li>Electron version: 1.6.2</li>
<li>Operating system: Windows 10</li>
</ul>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">When I'm maximizing the frameless window, the borders of window are out of screen.<br>
For example: If I have my custom titlebar with 100px height and if I'll maximize the window, the titlebar will be 96px height.</p>
<p dir="auto">On screenshot, the borders aren't out of screen.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Please clone my repository by using these commands:</p>
<p dir="auto">$ git clone <a href="https://github.com/nersent/wexond">https://github.com/nersent/wexond</a> -b refactor<br>
$ npm install<br>
$ npm run browser<br>
$ npm start</p>
<p dir="auto">Or create your own frameless window, then maximize it and see what happens.</p> | <ul dir="auto">
<li>Electron version: 1.4.15</li>
<li>Operating system: Windows 10</li>
</ul>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Height is oversized by exactly 8px consistently (taskbar is set to small icons).</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/adi518/electron-frameless-maximize-test/master/issue.jpg"><img src="https://raw.githubusercontent.com/adi518/electron-frameless-maximize-test/master/issue.jpg" alt="Alt" style="max-width: 100%;"></a></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><a href="https://github.com/adi518/electron-frameless-maximize-test">https://github.com/adi518/electron-frameless-maximize-test</a></p> | 1 |
<p dir="auto">Given the new <code class="notranslate">this</code> return type and F-bounded polymorphism I was a little surprised that I still could not express a functor interface</p>
<p dir="auto"><strong>Example of Problem</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface IFunctor<A> {
/** Maps `A` into `B` */
map<B>(f: (a: A) => B): IFunctor<B>;
}
// A class with more than just IFunctor in it.
class Maybe<A> implements IFunctor<A> {
constructor(init: A) { this.value = init; }
isEmpty(): boolean { return false; }
map<B>(f: (a: A) => B): IFunctor<B> { return new Maybe(f(this.value)); }
}
function toString<F extends IFunctor<any>>(a: F) {
return a.map((v: any) => '' + v); // no way to define that this returns F<string>
}
let a: Maybe<number> = new Maybe(100);
let b: Maybe<string> = toString(a);
// error TS2322: Type 'IFunctor<string>' is not assignable to type 'Maybe<string>'."><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">IFunctor</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-c1">></span> <span class="pl-kos">{</span>
<span class="pl-c">/** Maps `A` into `B` */</span>
<span class="pl-c1">map</span><span class="pl-c1"><</span><span class="pl-smi">B</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">f</span>: <span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">B</span><span class="pl-kos">)</span>: <span class="pl-smi">IFunctor</span><span class="pl-kos"><</span><span class="pl-smi">B</span><span class="pl-kos">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// A class with more than just IFunctor in it.</span>
<span class="pl-k">class</span> <span class="pl-smi">Maybe</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-c1">></span> <span class="pl-k">implements</span> <span class="pl-smi">IFunctor</span><span class="pl-kos"><</span><span class="pl-smi">A</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">init</span>: <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">init</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-en">isEmpty</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">false</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-en">map</span><span class="pl-c1"><</span><span class="pl-smi">B</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">f</span>: <span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">B</span><span class="pl-kos">)</span>: <span class="pl-smi">IFunctor</span><span class="pl-kos"><</span><span class="pl-smi">B</span><span class="pl-kos">></span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">Maybe</span><span class="pl-kos">(</span><span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">toString</span><span class="pl-c1"><</span><span class="pl-smi">F</span> <span class="pl-k">extends</span> <span class="pl-smi">IFunctor</span><span class="pl-kos"><</span><span class="pl-smi">any</span><span class="pl-kos">></span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">F</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">v</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s">''</span> <span class="pl-c1">+</span> <span class="pl-s1">v</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// no way to define that this returns F<string></span>
<span class="pl-kos">}</span>
<span class="pl-k">let</span> <span class="pl-s1">a</span>: <span class="pl-smi">Maybe</span><span class="pl-kos"><</span><span class="pl-smi">number</span><span class="pl-kos">></span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Maybe</span><span class="pl-kos">(</span><span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">b</span>: <span class="pl-smi">Maybe</span><span class="pl-kos"><</span><span class="pl-smi">string</span><span class="pl-kos">></span> <span class="pl-c1">=</span> <span class="pl-en">toString</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// error TS2322: Type 'IFunctor<string>' is not assignable to type 'Maybe<string>'.</span></pre></div>
<p dir="auto"><strong>Ideal Solution:</strong><br>
Ideally we should be able to define that F needs to have a generic type, which we can change</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface IFunctor<A, F<A> extends IFunctor<> {
/** Maps `A` into `B` */
map<B>(f: (a: A) => B): F<B>;
}"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">IFunctor</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">F</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-c1">></span> <span class="pl-k">extends</span> <span class="pl-smi">IFunctor</span><span class="pl-kos"><</span><span class="pl-smi"></span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-c">/** Maps `A` into `B` */</span>
<span class="pl-c1">map</span><span class="pl-c1"><</span><span class="pl-smi">B</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">f</span>: <span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">B</span><span class="pl-kos">)</span>: <span class="pl-smi">F</span><span class="pl-kos"><</span><span class="pl-smi">B</span><span class="pl-kos">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">or we can define the functions generics</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function toString<A, F<A> extends IFunctor<A>>(a: F<A>): F<string> { ... }"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-s1">toString</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">F</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-c1">></span> <span class="pl-k">extends</span> <span class="pl-smi">IFunctor</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-c1">></span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">F</span><span class="pl-kos"><</span><span class="pl-smi">A</span><span class="pl-kos">></span><span class="pl-kos">)</span>: <span class="pl-smi">F</span><span class="pl-kos"><</span><span class="pl-smi">string</span><span class="pl-kos">></span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span></pre></div> | <p dir="auto">It would be enormously helpful if <code class="notranslate">this</code> recognized type parameters:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract class Functor<a> {
abstract map<b>(map: (value: a) => b): this<b>;
}
abstract class Monad<a> extends Functor<a> {
abstract bind<b>(bind: (value: a) => this<b>): this<b>;
}"><pre class="notranslate"><span class="pl-k">abstract</span> <span class="pl-k">class</span> <span class="pl-smi">Functor</span><span class="pl-c1"><</span><span class="pl-smi">a</span><span class="pl-c1">></span> <span class="pl-kos">{</span>
<span class="pl-k">abstract</span> <span class="pl-c1">map</span><span class="pl-c1"><</span><span class="pl-smi">b</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">map</span>: <span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">a</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">b</span><span class="pl-kos">)</span>: <span class="pl-smi">this</span><span class="pl-c1"><</span><span class="pl-smi">b</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">abstract</span> <span class="pl-k">class</span> <span class="pl-smi">Monad</span><span class="pl-c1"><</span><span class="pl-smi">a</span><span class="pl-c1">></span> <span class="pl-k">extends</span> <span class="pl-smi">Functor</span><span class="pl-kos"><</span><span class="pl-smi">a</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-k">abstract</span> <span class="pl-c1">bind</span><span class="pl-c1"><</span><span class="pl-smi">b</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">bind</span>: <span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">a</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">this</span><span class="pl-c1"><</span><span class="pl-smi">b</span><span class="pl-c1">></span><span class="pl-kos">)</span>: <span class="pl-smi">this</span><span class="pl-c1"><</span><span class="pl-smi">b</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div> | 1 |
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => :4.0beta:</li>
<li>Operating System / Platform => :Windows 10 64 bit:</li>
<li>Compiler => :Visual studio 2017:</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Assertion failed when import caffe model, the message is as follws:</p>
<p dir="auto">OpenCV: terminate handler is called! The last OpenCV error is:<br>
OpenCV(4.0.0-beta) Error: Assertion failed (pbBlob.raw_data_type() == caffe::FLOAT16) in cv::dnn::dnn4_v20180917::`anonymous-namespace'::CaffeImporter::blobFromProto, file c:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\caffe\caffe_importer.cpp, line 264</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">const String model_desc = "../resnet18.prototxt";<br>
const String model_binary = "../resnet18.caffemodel";</p>
<p dir="auto">int test_caffe()<br>
{</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// init model
Net net = readNetFromCaffe(model_desc, model_binary);
if (net.empty())
{
printf("=> load net failed.\n");
return -1;
}
return 0;"><pre class="notranslate"><code class="notranslate">// init model
Net net = readNetFromCaffe(model_desc, model_binary);
if (net.empty())
{
printf("=> load net failed.\n");
return -1;
}
return 0;
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">int main()<br>
{<br>
//test_onnx();<br>
test_caffe();<br>
printf("=> Test done.\n");<br>
system("pause");</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="return 0;"><pre class="notranslate"><code class="notranslate">return 0;
</code></pre></div>
<p dir="auto">}</p> | <h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Operating System / Platform => <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Compiler => <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
</ul>
<h5 dir="auto">Detailed description</h5>
<h5 dir="auto">Steps to reproduce</h5> | 0 |
<p dir="auto">reported: <a href="https://www.facebook.com/groups/free.code.camp.bengaluru/761870870602896/?ref=notif&notif_t=group_activity" rel="nofollow">https://www.facebook.com/groups/free.code.camp.bengaluru/761870870602896/?ref=notif&notif_t=group_activity</a><br>
Screen shot: <a href="https://scontent.fsnc1-1.fna.fbcdn.net/hphotos-xpf1/t31.0-8/11888635_963123300399960_4127102090052504172_o.jpg" rel="nofollow">https://scontent.fsnc1-1.fna.fbcdn.net/hphotos-xpf1/t31.0-8/11888635_963123300399960_4127102090052504172_o.jpg</a></p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence" rel="nofollow">http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence</a> has an issue. The Bonfire asks to "Return the provided string with the first letter of each word capitalized".The sentence should be worded differently because it should specify that all the letters remaining should be lower case. I realized this just at the moment of my submission looking at the tests.</p> | 1 |
<p dir="auto">We should change this:</p>
<p dir="auto"><code class="notranslate">import { some-module } from 'some-lib'</code></p>
<p dir="auto">To this:</p>
<p dir="auto"><code class="notranslate">from 'some-lib' import {some-module}</code></p>
<p dir="auto">If we change to the second, the IDE can help us out by auto-completing the modules which we can import. In the first case we still can do it, but it's unnatural, we have to type everything and then come back.</p> | <p dir="auto">Consider the following import statement:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { int, float } from '../lang';"><pre class="notranslate"><code class="notranslate">import { int, float } from '../lang';
</code></pre></div>
<p dir="auto">With auto-suggest I need to start this by typing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import {} from '../lang';"><pre class="notranslate"><code class="notranslate">import {} from '../lang';
</code></pre></div>
<p dir="auto">Then I can go back inside the {} and get auto-suggestions.</p>
<p dir="auto">It would be very nice if TypeScript supported an alternate syntax for the same expression that was more conducive to auto-complete features.<br>
For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import from '../lang' { int, float };"><pre class="notranslate"><code class="notranslate">import from '../lang' { int, float };
</code></pre></div>
<p dir="auto">This doesn't introduce any confusion or ambiguity about the meaning of the expression, either to the transpiler or the human reader, yet it provides a time-saving experience to the author when taking advantage of auto-complete features. I can now simply type the expression naturally from left to right, and get auto-suggestions/completions for both the <strong>from '...'</strong> and <strong>{}</strong>.</p>
<p dir="auto">There are other cases where an alternate syntax would be beneficial. I will update this issue as I compile a list. Hopefully others will comment with suggestions as well.</p> | 1 |
<p dir="auto">The issue is about several reducing functions such as <code class="notranslate">np.mean</code> or <code class="notranslate">np.std</code>. These functions seem to return a different result when passed a 2D array together with <code class="notranslate">axis</code> argument instead of 1D array which is manually subscripted. Formally these two methods describe the exact same operation and so they should return the same result. For example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a = np.random.uniform(size=(100, 2))
assert np.mean(a, axis=0)[0] == np.mean(a[:, 0])"><pre class="notranslate"><span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">uniform</span>(<span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">100</span>, <span class="pl-c1">2</span>))
<span class="pl-k">assert</span> <span class="pl-s1">np</span>.<span class="pl-en">mean</span>(<span class="pl-s1">a</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s1">np</span>.<span class="pl-en">mean</span>(<span class="pl-s1">a</span>[:, <span class="pl-c1">0</span>])</pre></div>
<p dir="auto">However the above assertion fails for various sizes of the 0th-axis.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
def check(f, a):
axis = f(a, axis=0)
manual = f(a[:, 0]), f(a[:, 1])
print(axis[0] == manual[0])
print(axis[1] == manual[1])
print('0: {:e}'.format(axis[0] - manual[0]))
print('1: {:e}'.format(axis[1] - manual[1]))
print()
a1 = np.empty(shape=(5, 2), dtype=float)
a1[:, 0] = 0.69646919
a1[:, 1] = 0.28613933
a2 = np.empty(shape=(100, 2), dtype=float)
a2[:, 0] = 0.69646919
a2[:, 1] = 0.28613933
print('=== Checking a1 ===', end='\n\n')
check(np.mean, a1) # Pass.
check(np.std, a1) # Pass.
check(np.var, a1) # Pass.
check(np.sum, a1) # Pass.
print('=== Checking a2 ===', end='\n\n')
check(np.mean, a2) # Fail.
check(np.std, a2) # Fail.
check(np.var, a2) # Fail.
check(np.sum, a2) # Fail."><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">def</span> <span class="pl-en">check</span>(<span class="pl-s1">f</span>, <span class="pl-s1">a</span>):
<span class="pl-s1">axis</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">a</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-s1">manual</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">a</span>[:, <span class="pl-c1">0</span>]), <span class="pl-en">f</span>(<span class="pl-s1">a</span>[:, <span class="pl-c1">1</span>])
<span class="pl-en">print</span>(<span class="pl-s1">axis</span>[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s1">manual</span>[<span class="pl-c1">0</span>])
<span class="pl-en">print</span>(<span class="pl-s1">axis</span>[<span class="pl-c1">1</span>] <span class="pl-c1">==</span> <span class="pl-s1">manual</span>[<span class="pl-c1">1</span>])
<span class="pl-en">print</span>(<span class="pl-s">'0: {:e}'</span>.<span class="pl-en">format</span>(<span class="pl-s1">axis</span>[<span class="pl-c1">0</span>] <span class="pl-c1">-</span> <span class="pl-s1">manual</span>[<span class="pl-c1">0</span>]))
<span class="pl-en">print</span>(<span class="pl-s">'1: {:e}'</span>.<span class="pl-en">format</span>(<span class="pl-s1">axis</span>[<span class="pl-c1">1</span>] <span class="pl-c1">-</span> <span class="pl-s1">manual</span>[<span class="pl-c1">1</span>]))
<span class="pl-en">print</span>()
<span class="pl-s1">a1</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">5</span>, <span class="pl-c1">2</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">float</span>)
<span class="pl-s1">a1</span>[:, <span class="pl-c1">0</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.69646919</span>
<span class="pl-s1">a1</span>[:, <span class="pl-c1">1</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.28613933</span>
<span class="pl-s1">a2</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">100</span>, <span class="pl-c1">2</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">float</span>)
<span class="pl-s1">a2</span>[:, <span class="pl-c1">0</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.69646919</span>
<span class="pl-s1">a2</span>[:, <span class="pl-c1">1</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.28613933</span>
<span class="pl-en">print</span>(<span class="pl-s">'=== Checking a1 ==='</span>, <span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s">'<span class="pl-cce">\n</span><span class="pl-cce">\n</span>'</span>)
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">mean</span>, <span class="pl-s1">a1</span>) <span class="pl-c"># Pass.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">std</span>, <span class="pl-s1">a1</span>) <span class="pl-c"># Pass.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">var</span>, <span class="pl-s1">a1</span>) <span class="pl-c"># Pass.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">sum</span>, <span class="pl-s1">a1</span>) <span class="pl-c"># Pass.</span>
<span class="pl-en">print</span>(<span class="pl-s">'=== Checking a2 ==='</span>, <span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s">'<span class="pl-cce">\n</span><span class="pl-cce">\n</span>'</span>)
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">mean</span>, <span class="pl-s1">a2</span>) <span class="pl-c"># Fail.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">std</span>, <span class="pl-s1">a2</span>) <span class="pl-c"># Fail.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">var</span>, <span class="pl-s1">a2</span>) <span class="pl-c"># Fail.</span>
<span class="pl-en">check</span>(<span class="pl-s1">np</span>.<span class="pl-s1">sum</span>, <span class="pl-s1">a2</span>) <span class="pl-c"># Fail.</span></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=">>> import sys, numpy; print(numpy.__version__, sys.version)
1.15.0 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609]"><pre class="notranslate"><span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">sys</span>, <span class="pl-s1">numpy</span>; <span class="pl-en">print</span>(<span class="pl-s1">numpy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">sys</span>.<span class="pl-s1">version</span>)
<span class="pl-c1">1.15</span>.<span class="pl-c1">0</span> <span class="pl-c1">3.5</span>.<span class="pl-c1">2</span> (<span class="pl-s1">default</span>, <span class="pl-v">Nov</span> <span class="pl-c1">23</span> <span class="pl-c1">2017</span>, <span class="pl-c1">16</span>:<span class="pl-c1">37</span>:<span class="pl-c1">01</span>)
[<span class="pl-v">GCC</span> <span class="pl-c1">5.4</span><span class="pl-c1">.0</span> <span class="pl-c1">20160609</span>]</pre></div>
<h3 dir="auto">Further investigation</h3>
<p dir="auto">Checking various sizes for the 0th-axis for various methods:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import pandas as pd
def generate(n):
a = np.empty(shape=(n, 2), dtype=float)
a[:, 0] = 0.69646919
a[:, 1] = 0.28613933
return a
def check(f, a):
axis = f(a, axis=0)
manual = f(a[:, 0]), f(a[:, 1])
return axis[0] == manual[0] and axis[1] == manual[1]
funcs = ['mean', 'std', 'var', 'sum', 'prod']
results = []
for f in map(lambda x: getattr(np, x), funcs):
results.append([check(f, generate(i)) for i in range(2, 101)])
with pd.option_context('display.max_rows', None):
print(pd.DataFrame(
columns=funcs,
index=range(2, 101),
data=np.asarray(results).T
))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">def</span> <span class="pl-en">generate</span>(<span class="pl-s1">n</span>):
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-s1">n</span>, <span class="pl-c1">2</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">float</span>)
<span class="pl-s1">a</span>[:, <span class="pl-c1">0</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.69646919</span>
<span class="pl-s1">a</span>[:, <span class="pl-c1">1</span>] <span class="pl-c1">=</span> <span class="pl-c1">0.28613933</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span>
<span class="pl-k">def</span> <span class="pl-en">check</span>(<span class="pl-s1">f</span>, <span class="pl-s1">a</span>):
<span class="pl-s1">axis</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">a</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-s1">manual</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">a</span>[:, <span class="pl-c1">0</span>]), <span class="pl-en">f</span>(<span class="pl-s1">a</span>[:, <span class="pl-c1">1</span>])
<span class="pl-k">return</span> <span class="pl-s1">axis</span>[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s1">manual</span>[<span class="pl-c1">0</span>] <span class="pl-c1">and</span> <span class="pl-s1">axis</span>[<span class="pl-c1">1</span>] <span class="pl-c1">==</span> <span class="pl-s1">manual</span>[<span class="pl-c1">1</span>]
<span class="pl-s1">funcs</span> <span class="pl-c1">=</span> [<span class="pl-s">'mean'</span>, <span class="pl-s">'std'</span>, <span class="pl-s">'var'</span>, <span class="pl-s">'sum'</span>, <span class="pl-s">'prod'</span>]
<span class="pl-s1">results</span> <span class="pl-c1">=</span> []
<span class="pl-k">for</span> <span class="pl-s1">f</span> <span class="pl-c1">in</span> <span class="pl-en">map</span>(<span class="pl-k">lambda</span> <span class="pl-s1">x</span>: <span class="pl-en">getattr</span>(<span class="pl-s1">np</span>, <span class="pl-s1">x</span>), <span class="pl-s1">funcs</span>):
<span class="pl-s1">results</span>.<span class="pl-en">append</span>([<span class="pl-en">check</span>(<span class="pl-s1">f</span>, <span class="pl-en">generate</span>(<span class="pl-s1">i</span>)) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">2</span>, <span class="pl-c1">101</span>)])
<span class="pl-k">with</span> <span class="pl-s1">pd</span>.<span class="pl-en">option_context</span>(<span class="pl-s">'display.max_rows'</span>, <span class="pl-c1">None</span>):
<span class="pl-en">print</span>(<span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(
<span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">funcs</span>,
<span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-en">range</span>(<span class="pl-c1">2</span>, <span class="pl-c1">101</span>),
<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-en">asarray</span>(<span class="pl-s1">results</span>).<span class="pl-v">T</span>
))</pre></div>
<p dir="auto">This yields the following results:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" mean std var sum prod
2 True True True True True
3 True True True True True
4 True True True True True
5 True True True True True
6 True True True True True
7 True True True True True
8 False False False False True
9 False False False False True
10 False False False False True
11 True True True False True
12 True True True False True
13 True True True False True
14 True True True True True
15 True True True True True
16 False False False False True
17 False False False False True
18 False False False False True
19 False False False False True
20 False False False False True
21 False False False False True
22 True True True False True
23 False False False False True
24 False False False False True
25 False False False False True
26 False False False False True
27 False False False False True
28 False False False False True
29 False False False False True
30 False False False False True
31 False False False False True
32 False False False False True
33 False False False False True
34 False False False False True
35 False False False False True
36 False False False False True
37 False False False False True
38 False False False False True
39 False False False False True
40 False False False False True
41 False False False False True
42 False False False False True
43 False False False False True
44 False False False False True
45 False False False False True
46 False False False False True
47 False False False False True
48 False False False False True
49 False False False False True
50 False False False False True
51 False False False False True
52 False False False False True
53 False False False False True
54 False False False False True
55 False False False False True
56 False False False False True
57 False False False False True
58 False False False False True
59 False False False False True
60 False False False False True
61 False False False False True
62 False False False False True
63 False False False False True
64 False False False False True
65 False False False False True
66 False True True False True
67 False True True False True
68 False True True False True
69 False False False False True
70 False False False False True
71 False False False False True
72 False False False False True
73 False False False False True
74 False False False False True
75 False False False False True
76 False False False False True
77 False False False False True
78 False False False False True
79 False False False False True
80 False False False False True
81 False False False False True
82 False False False False True
83 False False False False True
84 False False False False True
85 False False False False True
86 False False False False True
87 False False False False True
88 False False False False True
89 False False False False True
90 False False False False True
91 False False False False True
92 False False False False True
93 False False False False True
94 False False False False True
95 False False False False True
96 False False False False True
97 False False False False True
98 False False False False True
99 False False False False True
100 False False False False True"><pre class="notranslate"> <span class="pl-s1">mean</span> <span class="pl-s1">std</span> <span class="pl-s1">var</span> <span class="pl-s1">sum</span> <span class="pl-s1">prod</span>
<span class="pl-c1">2</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">3</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">4</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">5</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">6</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">7</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">8</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">9</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">10</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">11</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">12</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">13</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">14</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">15</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span>
<span class="pl-c1">16</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">17</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">18</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">19</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">20</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">21</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">22</span> <span class="pl-v">True</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">23</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">24</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">25</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">26</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">27</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">28</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">29</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">30</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">31</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">32</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">33</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">34</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">35</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">36</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">37</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">38</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">39</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">40</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">41</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">42</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">43</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">44</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">45</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">46</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">47</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">48</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">49</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">50</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">51</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">52</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">53</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">54</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">55</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">56</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">57</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">58</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">59</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">60</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">61</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">62</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">63</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">64</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">65</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">66</span> <span class="pl-v">False</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">67</span> <span class="pl-v">False</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">68</span> <span class="pl-v">False</span> <span class="pl-c1">True</span> <span class="pl-v">True</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">69</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">70</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">71</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">72</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">73</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">74</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">75</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">76</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">77</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">78</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">79</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">80</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">81</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">82</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">83</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">84</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">85</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">86</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">87</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">88</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">89</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">90</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">91</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">92</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">93</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">94</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">95</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">96</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">97</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">98</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">99</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span>
<span class="pl-c1">100</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">False</span> <span class="pl-c1">False</span> <span class="pl-v">True</span></pre></div> | <p dir="auto">On Numpy 1.14.2 I get the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="A = np.random.rand(1024,256,256,3)*255 # similar to a 1024 256x256 images tensor
print(np.mean(A,axis=(0,1,2))) # 64 bit works fine
print(np.mean(A.astype(np.float32),axis=(0,1,2))) # 32 bit works fails
print(np.mean(A.astype(np.float32))) # 32 bit works fine if without axis selection"><pre class="notranslate"><code class="notranslate">A = np.random.rand(1024,256,256,3)*255 # similar to a 1024 256x256 images tensor
print(np.mean(A,axis=(0,1,2))) # 64 bit works fine
print(np.mean(A.astype(np.float32),axis=(0,1,2))) # 32 bit works fails
print(np.mean(A.astype(np.float32))) # 32 bit works fine if without axis selection
</code></pre></div>
<p dir="auto">results in:<br>
[127.50656009 127.49165182 127.51390158]<br>
[64. 64. 64.]<br>
127.50413</p>
<p dir="auto">Even considering float32 precision, this type of failure seems odd, especially given that the entire array's mean can be calculated succesfully</p> | 1 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#![feature(associated_types)]
impl Foo for int {
type A = uint;
}
pub trait Foo {
type A;
}
pub fn main() {}"><pre class="notranslate"><code class="notranslate">#![feature(associated_types)]
impl Foo for int {
type A = uint;
}
pub trait Foo {
type A;
}
pub fn main() {}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 13 } in tcx.impl_or_trait_items', /home/ncameron/rust/src/librustc/middle/ty.rs:4310
stack backtrace:
1: 0x7f1940943440 - rt::backtrace::imp::write::h0f67e562de667d35Gay
2: 0x7f19409478b0 - failure::on_fail::h58a0ff7a5099a6000Cy
3: 0x7f19405fec80 - unwind::begin_unwind_inner::ha57e93b5d4f1f80d1Qc
4: 0x7f19405fe7e0 - unwind::begin_unwind_fmt::ha9fc4b78efd146fccOc
5: 0x7f193f4ead30 - middle::ty::impl_or_trait_item::h55c274f1e1ee9b78Xl8
6: 0x7f193f95cc40 - middle::typeck::collect::ImplCtxt<'a, 'tcx>.AstConv<'tcx>::associated_type_binding::hcc097ca1cd60b433DCK
7: 0x7f193f994750 - middle::typeck::astconv::create_substs_for_ast_path::h12687352172379627279
8: 0x7f193f87e830 - middle::typeck::collect::convert::h51f7fcfe7a681561cXK
9: 0x7f193f878890 - middle::typeck::collect::collect_item_types::hf182a64ac9f0ea5eORJ
10: 0x7f193f751d10 - util::common::time::h13554638601947919603
11: 0x7f193f751310 - middle::typeck::check_crate::h9b48aa6c28528690bQP
12: 0x7f1940f43120 - driver::driver::phase_3_run_analysis_passes::h938db519a111a7574nS
13: 0x7f1940f3c410 - driver::driver::compile_input::h282769b6ecf9b18b44R
14: 0x7f1940fb9260 - driver::run::closure.61472
15: 0x7f1940fc6290 - task::TaskBuilder::try_future::closure.62104
16: 0x7f194093a910 - task::TaskBuilder::spawn_internal::closure.31177
17: 0x7f1940600b90 - task::Task::spawn::closure.5779
18: 0x7f194065b090 - rust_try_inner
19: 0x7f194065b080 - rust_try
20: 0x7f19405fe540 - unwind::try::heee2f446c60ea967mFc
21: 0x7f1940600a40 - task::Task::run::h7f1d4c2e55b46abdeOb
22: 0x7f1940600810 - task::Task::spawn::closure.5755
23: 0x7f1940604350 - thread::thread_start::hc7adf40c9d3bfc57h6b
24: 0x7f193b83a0c0 - start_thread
25: 0x7f19402bef89 - __clone
26: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate">task 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 13 } in tcx.impl_or_trait_items', /home/ncameron/rust/src/librustc/middle/ty.rs:4310
stack backtrace:
1: 0x7f1940943440 - rt::backtrace::imp::write::h0f67e562de667d35Gay
2: 0x7f19409478b0 - failure::on_fail::h58a0ff7a5099a6000Cy
3: 0x7f19405fec80 - unwind::begin_unwind_inner::ha57e93b5d4f1f80d1Qc
4: 0x7f19405fe7e0 - unwind::begin_unwind_fmt::ha9fc4b78efd146fccOc
5: 0x7f193f4ead30 - middle::ty::impl_or_trait_item::h55c274f1e1ee9b78Xl8
6: 0x7f193f95cc40 - middle::typeck::collect::ImplCtxt<'a, 'tcx>.AstConv<'tcx>::associated_type_binding::hcc097ca1cd60b433DCK
7: 0x7f193f994750 - middle::typeck::astconv::create_substs_for_ast_path::h12687352172379627279
8: 0x7f193f87e830 - middle::typeck::collect::convert::h51f7fcfe7a681561cXK
9: 0x7f193f878890 - middle::typeck::collect::collect_item_types::hf182a64ac9f0ea5eORJ
10: 0x7f193f751d10 - util::common::time::h13554638601947919603
11: 0x7f193f751310 - middle::typeck::check_crate::h9b48aa6c28528690bQP
12: 0x7f1940f43120 - driver::driver::phase_3_run_analysis_passes::h938db519a111a7574nS
13: 0x7f1940f3c410 - driver::driver::compile_input::h282769b6ecf9b18b44R
14: 0x7f1940fb9260 - driver::run::closure.61472
15: 0x7f1940fc6290 - task::TaskBuilder::try_future::closure.62104
16: 0x7f194093a910 - task::TaskBuilder::spawn_internal::closure.31177
17: 0x7f1940600b90 - task::Task::spawn::closure.5779
18: 0x7f194065b090 - rust_try_inner
19: 0x7f194065b080 - rust_try
20: 0x7f19405fe540 - unwind::try::heee2f446c60ea967mFc
21: 0x7f1940600a40 - task::Task::run::h7f1d4c2e55b46abdeOb
22: 0x7f1940600810 - task::Task::spawn::closure.5755
23: 0x7f1940604350 - thread::thread_start::hc7adf40c9d3bfc57h6b
24: 0x7f193b83a0c0 - start_thread
25: 0x7f19402bef89 - __clone
26: 0x0 - <unknown>
</code></pre></div> | <p dir="auto">Not sure how to properly describe the bug, but this causes an ICE:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(associated_types)]
struct SimulationInfo;
impl SimulationInfo {
fn add_state<T: HasState>(&mut self, op: || -> <T as HasState>::State)
-> Option<&mut <T as HasState>::State> {
None
}
}
trait HasState {
type State;
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>associated_types<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">struct</span> <span class="pl-smi">SimulationInfo</span><span class="pl-kos">;</span>
<span class="pl-k">impl</span> <span class="pl-smi">SimulationInfo</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">add_state</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">HasState</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">,</span> <span class="pl-s1">op</span><span class="pl-kos">:</span> || -> <<span class="pl-smi">T</span> <span class="pl-k">as</span> <span class="pl-smi">HasState</span>><span class="pl-kos">::</span><span class="pl-smi">State</span><span class="pl-kos">)</span>
-> <span class="pl-smi">Option</span><span class="pl-kos"><</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <<span class="pl-smi">T</span> <span class="pl-k">as</span> <span class="pl-smi">HasState</span>><span class="pl-kos">::</span><span class="pl-smi">State</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-v">None</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">trait</span> <span class="pl-smi">HasState</span> <span class="pl-kos">{</span>
<span class="pl-k">type</span> <span class="pl-smi">State</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Whereas this compiles:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(associated_types)]
struct SimulationInfo;
trait HasState {
type State;
}
impl SimulationInfo {
fn add_state<T: HasState>(&mut self, op: || -> <T as HasState>::State)
-> Option<&mut <T as HasState>::State> {
None
}
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>associated_types<span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">struct</span> <span class="pl-smi">SimulationInfo</span><span class="pl-kos">;</span>
<span class="pl-k">trait</span> <span class="pl-smi">HasState</span> <span class="pl-kos">{</span>
<span class="pl-k">type</span> <span class="pl-smi">State</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">impl</span> <span class="pl-smi">SimulationInfo</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">add_state</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">HasState</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">,</span> <span class="pl-s1">op</span><span class="pl-kos">:</span> || -> <<span class="pl-smi">T</span> <span class="pl-k">as</span> <span class="pl-smi">HasState</span>><span class="pl-kos">::</span><span class="pl-smi">State</span><span class="pl-kos">)</span>
-> <span class="pl-smi">Option</span><span class="pl-kos"><</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <<span class="pl-smi">T</span> <span class="pl-k">as</span> <span class="pl-smi">HasState</span>><span class="pl-kos">::</span><span class="pl-smi">State</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-v">None</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Failure:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 33 } in tcx.impl_or_trait_items', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librustc/middle/ty.rs:4066
stack backtrace:
1: 0x10d45a619 - rt::backtrace::imp::write::h03fee16d4a0b6b41moq
2: 0x10d45d85c - failure::on_fail::h3e0f6b3c6c4bbcc3VEq
3: 0x10d6bcf05 - unwind::begin_unwind_inner::h6c7f4532e72658d7SJd
4: 0x10d6bcb9f - unwind::begin_unwind_fmt::h9863b25c438d6314kHd
5: 0x10a408d50 - middle::ty::impl_or_trait_item::h8676078de6338b03J2J
6: 0x10a7fe51e - middle::typeck::collect::convert_methods::ty_of_method::h1b65fc29f839dd39kEi
7: 0x10a7a4b84 - middle::typeck::collect::convert::hf5d19782a9342fbfL7i
8: 0x10a79c993 - middle::typeck::collect::collect_item_types::h2af040048993f98298h
9: 0x10a1bb556 - util::common::time::h11920059333862041717
10: 0x10a965478 - middle::typeck::check_crate::h50fcc5c8b39993f4LVn
11: 0x10a9cdbcf - driver::driver::phase_3_run_analysis_passes::h1425a4ca465c7b097DA
12: 0x10a9c82b8 - driver::driver::compile_input::h60bc42ef7fabbfd4SkA
13: 0x10aa45ca8 - driver::run_compiler::h4031243f49082a9fw7D
14: 0x10aa43ece - driver::run::closure.145349
15: 0x10a1d381b - task::TaskBuilder<S>::try_future::closure.103709
16: 0x10a1d3713 - task::TaskBuilder<S>::spawn_internal::closure.103680
17: 0x10a15398d - task::NativeSpawner.Spawner::spawn::closure.8526
18: 0x10d72320c - rust_try_inner
19: 0x10d7231f6 - rust_try
20: 0x10d6ba677 - unwind::try::hab84862d0081b274cyd
21: 0x10d6ba50c - task::Task::run::h39093ecd59554b49ZJc
22: 0x10a1537b3 - task::NativeSpawner.Spawner::spawn::closure.8463
23: 0x10d6bbd37 - thread::thread_start::h589be8c0a398d299e5c
24: 0x7fff9260c2fc - _pthread_body
25: 0x7fff9260c279 - _pthread_body"><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 33 } in tcx.impl_or_trait_items', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librustc/middle/ty.rs:4066
stack backtrace:
1: 0x10d45a619 - rt::backtrace::imp::write::h03fee16d4a0b6b41moq
2: 0x10d45d85c - failure::on_fail::h3e0f6b3c6c4bbcc3VEq
3: 0x10d6bcf05 - unwind::begin_unwind_inner::h6c7f4532e72658d7SJd
4: 0x10d6bcb9f - unwind::begin_unwind_fmt::h9863b25c438d6314kHd
5: 0x10a408d50 - middle::ty::impl_or_trait_item::h8676078de6338b03J2J
6: 0x10a7fe51e - middle::typeck::collect::convert_methods::ty_of_method::h1b65fc29f839dd39kEi
7: 0x10a7a4b84 - middle::typeck::collect::convert::hf5d19782a9342fbfL7i
8: 0x10a79c993 - middle::typeck::collect::collect_item_types::h2af040048993f98298h
9: 0x10a1bb556 - util::common::time::h11920059333862041717
10: 0x10a965478 - middle::typeck::check_crate::h50fcc5c8b39993f4LVn
11: 0x10a9cdbcf - driver::driver::phase_3_run_analysis_passes::h1425a4ca465c7b097DA
12: 0x10a9c82b8 - driver::driver::compile_input::h60bc42ef7fabbfd4SkA
13: 0x10aa45ca8 - driver::run_compiler::h4031243f49082a9fw7D
14: 0x10aa43ece - driver::run::closure.145349
15: 0x10a1d381b - task::TaskBuilder<S>::try_future::closure.103709
16: 0x10a1d3713 - task::TaskBuilder<S>::spawn_internal::closure.103680
17: 0x10a15398d - task::NativeSpawner.Spawner::spawn::closure.8526
18: 0x10d72320c - rust_try_inner
19: 0x10d7231f6 - rust_try
20: 0x10d6ba677 - unwind::try::hab84862d0081b274cyd
21: 0x10d6ba50c - task::Task::run::h39093ecd59554b49ZJc
22: 0x10a1537b3 - task::NativeSpawner.Spawner::spawn::closure.8463
23: 0x10d6bbd37 - thread::thread_start::h589be8c0a398d299e5c
24: 0x7fff9260c2fc - _pthread_body
25: 0x7fff9260c279 - _pthread_body
</code></pre></div> | 1 |
<p dir="auto">Hello,</p>
<p dir="auto">I upgrade my PHP version from PHP 5.6.36 to PHP 7.2, but I have a problem when I want to use the migrate function of Session component.</p>
<p dir="auto">My simple line of code :<br>
<code class="notranslate">$this->request->getSession()->migrate(true, $newLifetime);</code></p>
<p dir="auto">The error returned :<br>
<code class="notranslate">Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time </code></p>
<p dir="auto">I have already a session opened before by my login page, but I want to change the session life time on login.<br>
My Symfony version 2.8.44<br>
Thanks for your help</p> | <p dir="auto">My entity :</p>
<p dir="auto">/**</p>
<ul dir="auto">
<li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Orm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Orm">@Orm</a>\Column(type="string",length="50")
<ul dir="auto">
<li><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/Assert/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Assert">@Assert</a>\NotBlank()</li>
</ul>
</li>
<li><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/Assert/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Assert">@Assert</a>\Choice(choices = {"spring", "summer","autumn","winter"})<br>
*/<br>
private $season;</li>
</ul>
<p dir="auto">My Form :</p>
<p dir="auto">$builder->add('season', 'choice', array('choices' => array('spring'=>'season.spring','summer'=>'season.summer','autumn'=>'season.autumn','winter'=>'season.winter'),<br>
'multiple' => true,<br>
'expanded' => true<br>
));</p>
<p dir="auto">The validation is always false >> "The value you selected is not a valid choice"</p> | 0 |
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays" rel="nofollow">http://freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<ol dir="auto">
<li>GO to <a href="http://freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays" rel="nofollow">http://freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays</a></li>
<li>Check the unit test section. Script error being reported.</li>
<li>Not able to proceed with the test.</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4006402/9578086/c58e44fe-5004-11e5-8cde-d149fec99de3.png"><img src="https://cloud.githubusercontent.com/assets/4006402/9578086/c58e44fe-5004-11e5-8cde-d149fec99de3.png" alt="image" style="max-width: 100%;"></a></p> | <p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-write-reusable-javascript-with-functions" rel="nofollow">http://freecodecamp.com/challenges/waypoint-write-reusable-javascript-with-functions</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">The method of defining a function in the text differs from the method used in the code window. This may confuse campers.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1650358/9329912/8d6fb32c-4583-11e5-88e6-64aec8694fef.png"><img width="1275" alt="screen shot 2015-08-18 at 8 28 28 am" src="https://cloud.githubusercontent.com/assets/1650358/9329912/8d6fb32c-4583-11e5-88e6-64aec8694fef.png" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">Please note that the classes described in the first checkpoint are mixed up. The </p><div dir="auto">'s with class "well" should go within the <div dir="auto">'s with class "col-xs-6", instead of the other way around. Thank you!<p dir="auto"></p>
<p dir="auto">Repro steps:<br>
Go to <a href="http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells</a><br>
and observe the first checkpoint on the left.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5858417/9344789/100ec872-45c0-11e5-80c7-7b443dae7a62.png"><img src="https://cloud.githubusercontent.com/assets/5858417/9344789/100ec872-45c0-11e5-80c7-7b443dae7a62.png" alt="image" style="max-width: 100%;"></a></p></div></div> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/8844886/9320279/e81aebf6-450c-11e5-8a2b-c5b27affca4c.png"><img src="https://cloud.githubusercontent.com/assets/8844886/9320279/e81aebf6-450c-11e5-8a2b-c5b27affca4c.png" alt="image" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">I was using r112 and everything was ok, after upgrading to r120 I noticed a huge drop in fps when using composer render rather than the normal render.</p>
<p dir="auto">there are 7 objects, 2000 instanced objects.</p>
<p dir="auto">I know that 2000 sounds a big number, but it works well with normal rendering, and it was working well too in composer renders in r112!</p>
<p dir="auto"><em><strong>Live example</strong></em></p>
<p dir="auto"><a href="https://jsfiddle.net/xuqws0Lg/" rel="nofollow">https://jsfiddle.net/xuqws0Lg/</a></p>
<p dir="auto">you can switch between composer render and normal render in the animate function to see the diff</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">the expected behavior is that the composer renders in the same performance as normal render do.</p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: Desktop</li>
<li>OS: Linux</li>
<li>Browser: Chrome</li>
<li>Three.js version: r120</li>
</ul> | <p dir="auto">OutlinePass causes performance issue especially on mesh with a lot of faces.<br>
I am not sure if this is bug or expected behavior. Thanks.</p>
<p dir="auto"><strong>Screenshots</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42105279/93967893-d34c3800-fd9a-11ea-9a38-f0795b18bdf0.png"><img src="https://user-images.githubusercontent.com/42105279/93967893-d34c3800-fd9a-11ea-9a38-f0795b18bdf0.png" alt="image" style="max-width: 100%;"></a><br>
without outline (28ms)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42105279/93967940-eced7f80-fd9a-11ea-967c-7f7297ff07cb.png"><img src="https://user-images.githubusercontent.com/42105279/93967940-eced7f80-fd9a-11ea-967c-7f7297ff07cb.png" alt="image" style="max-width: 100%;"></a><br>
with outline on mesh(ground) with small number of faces. (57ms)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42105279/93968016-1ad2c400-fd9b-11ea-9a1a-ae505033191f.png"><img src="https://user-images.githubusercontent.com/42105279/93968016-1ad2c400-fd9b-11ea-9a1a-ae505033191f.png" alt="image" style="max-width: 100%;"></a><br>
with outline on mesh(tree) with a large number of faces. (170ms)</p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: [Desktop]</li>
<li>OS: [MacOS]</li>
<li>Browser: [Chrome]</li>
<li>Three.js version: [r118]</li>
</ul> | 1 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical enhancement to an existing feature.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed enhancements.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/main">commit log</a><br>
to find out if the if the same enhancement was already implemented in the<br>
main branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Brief Summary</h1>
<p dir="auto"><code class="notranslate">celery.utils.iso8601</code> is historic module which <code class="notranslate">.parse_iso8601()</code> can be replaced by <code class="notranslate">datetime.datetime.fromisoformat()</code> as Python 3.7 or above is now supported.</p>
<p dir="auto">Suggest deprecate this module and use <code class="notranslate">datetime.datetime.fromisoformat()</code> internally.</p>
<h1 dir="auto">Design</h1>
<h2 dir="auto">Architectural Considerations</h2>
<p dir="auto">None</p>
<h2 dir="auto">Proposed Behavior</h2>
<ul dir="auto">
<li><code class="notranslate">iso8601</code> module is still usable before v6.0.0, but with addition of deprecation warning</li>
<li>remove <code class="notranslate">iso8601</code> module in v6.0.0</li>
<li>replace all usage of <code class="notranslate">parse_iso8601()</code> in the library by <code class="notranslate">datetime.datetime.fromisoformat</code>, with compatibility of Python 3.7 to 3.11</li>
</ul>
<h2 dir="auto">Proposed UI/UX</h2>
<p dir="auto">N/A</p>
<h2 dir="auto">Diagrams</h2>
<p dir="auto">N/A</p>
<h2 dir="auto">Alternatives</h2>
<p dir="auto">None</p> | <h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>:</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="5.2.0 (dawn-chorus)"><pre class="notranslate"><code class="notranslate">5.2.0 (dawn-chorus)
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# This executes "as expected" - first the group, then the tasks all one after the other ...
post_processing = (task_doing_nothing.si() | task_doing_nothing.si())
workflow = chain(
group(
task_doing_nothing.si(),
task_doing_nothing.si(),
),
task_doing_nothing.si()
) | post_processing
workflow.delay().get()
# This executes the post processing chain twice ... which I dont understand ...
post_processing = (task_doing_nothing.si() | task_doing_nothing.si())
workflow = chain(
group(
task_doing_nothing.si(),
task_doing_nothing.si(),
),
task_doing_nothing.si()
)
workflow |= post_processing
workflow.delay().get()"><pre class="notranslate"><span class="pl-c"># This executes "as expected" - first the group, then the tasks all one after the other ...</span>
<span class="pl-s1">post_processing</span> <span class="pl-c1">=</span> (<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>() <span class="pl-c1">|</span> <span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>())
<span class="pl-s1">workflow</span> <span class="pl-c1">=</span> <span class="pl-en">chain</span>(
<span class="pl-en">group</span>(
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>(),
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>(),
),
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>()
) <span class="pl-c1">|</span> <span class="pl-s1">post_processing</span>
<span class="pl-s1">workflow</span>.<span class="pl-en">delay</span>().<span class="pl-en">get</span>()
<span class="pl-c"># This executes the post processing chain twice ... which I dont understand ...</span>
<span class="pl-s1">post_processing</span> <span class="pl-c1">=</span> (<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>() <span class="pl-c1">|</span> <span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>())
<span class="pl-s1">workflow</span> <span class="pl-c1">=</span> <span class="pl-en">chain</span>(
<span class="pl-en">group</span>(
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>(),
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>(),
),
<span class="pl-s1">task_doing_nothing</span>.<span class="pl-en">si</span>()
)
<span class="pl-s1">workflow</span> |= <span class="pl-s1">post_processing</span>
<span class="pl-s1">workflow</span>.<span class="pl-en">delay</span>().<span class="pl-en">get</span>()</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">I would expect no difference in the two approaches detailed above, i.e. I would not expect to post_processing chain to be executed twice.</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">Using the second approach post_processing chain is executed twice.</p> | 0 |
<p dir="auto">I am using Pandas 0.13.0rc1-23-g286811a, Python 2.7 and Windows XP.</p>
<p dir="auto">The space in column names is apparently causing a problem. On IPython,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(columns=['a', 'b', 'c c'])
df['d'] = 3
df['c c']"><pre class="notranslate"><code class="notranslate">df = pd.DataFrame(columns=['a', 'b', 'c c'])
df['d'] = 3
df['c c']
</code></pre></div>
<p dir="auto">Error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in __getitem__(self, key)
1626 return self._getitem_multilevel(key)
1627 else:
-> 1628 return self._getitem_column(key)
1629
1630 def _getitem_column(self, key):
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _getitem_column(self, key)
1633 # get column
1634 if self.columns.is_unique:
-> 1635 return self._get_item_cache(key)
1636
1637 # duplicate columns & possible reduce dimensionaility
C:\python_envs\prod2\lib\site-packages\pandas\core\generic.pyc in _get_item_cache(self, item)
977 if res is None:
978 values = self._data.get(item)
--> 979 res = self._box_item_values(item, values)
980 cache[item] = res
981 res._cacher = (item, weakref.ref(self))
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_item_values(self, key, values)
1834 return self._constructor(values.T, columns=items, index=self.index)
1835 else:
-> 1836 return self._box_col_values(values, items)
1837
1838 def _box_col_values(self, values, items):
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_col_values(self, values, items)
1839 """ provide boxed values for a column """
1840 return self._constructor_sliced.from_array(values, index=self.index,
-> 1841 name=items, fastpath=True)
1842
1843 def __setitem__(self, key, value):
C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in from_array(cls, arr, index, name, copy, fastpath)
233 cls = SparseSeries
234
--> 235 return cls(arr, index=index, name=name, copy=copy, fastpath=fastpath)
236
237 @property
C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in __init__(self, data, index, dtype, name, copy, fastpath
)
130 # data is an ndarray, index is defined
131 if not isinstance(data, SingleBlockManager):
--> 132 data = SingleBlockManager(data, index, fastpath=True)
133 if copy:
134 data = data.copy()
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, block, axis, do_integrity_check, fast
path)
3413 block = block[0]
3414 if not isinstance(block, Block):
-> 3415 block = make_block(block, axis, axis, ndim=1, fastpath=True)
3416
3417 else:
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in make_block(values, items, ref_items, klass, ndim, dt
ype, fastpath, placement)
1893
1894 return klass(values, items, ref_items, ndim=ndim, fastpath=fastpath,
-> 1895 placement=placement)
1896
1897
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
1297 super(ObjectBlock, self).__init__(values, items, ref_items, ndim=ndim,
1298 fastpath=fastpath,
-> 1299 placement=placement)
1300
1301 @property
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
63 if len(items) != len(values):
64 raise ValueError('Wrong number of items passed %d, indices imply '
---> 65 '%d' % (len(items), len(values)))
66
67 self.set_ref_locs(placement)
ValueError: Wrong number of items passed 1, indices imply 0"><pre class="notranslate"><code class="notranslate">C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in __getitem__(self, key)
1626 return self._getitem_multilevel(key)
1627 else:
-> 1628 return self._getitem_column(key)
1629
1630 def _getitem_column(self, key):
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _getitem_column(self, key)
1633 # get column
1634 if self.columns.is_unique:
-> 1635 return self._get_item_cache(key)
1636
1637 # duplicate columns & possible reduce dimensionaility
C:\python_envs\prod2\lib\site-packages\pandas\core\generic.pyc in _get_item_cache(self, item)
977 if res is None:
978 values = self._data.get(item)
--> 979 res = self._box_item_values(item, values)
980 cache[item] = res
981 res._cacher = (item, weakref.ref(self))
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_item_values(self, key, values)
1834 return self._constructor(values.T, columns=items, index=self.index)
1835 else:
-> 1836 return self._box_col_values(values, items)
1837
1838 def _box_col_values(self, values, items):
C:\python_envs\prod2\lib\site-packages\pandas\core\frame.pyc in _box_col_values(self, values, items)
1839 """ provide boxed values for a column """
1840 return self._constructor_sliced.from_array(values, index=self.index,
-> 1841 name=items, fastpath=True)
1842
1843 def __setitem__(self, key, value):
C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in from_array(cls, arr, index, name, copy, fastpath)
233 cls = SparseSeries
234
--> 235 return cls(arr, index=index, name=name, copy=copy, fastpath=fastpath)
236
237 @property
C:\python_envs\prod2\lib\site-packages\pandas\core\series.pyc in __init__(self, data, index, dtype, name, copy, fastpath
)
130 # data is an ndarray, index is defined
131 if not isinstance(data, SingleBlockManager):
--> 132 data = SingleBlockManager(data, index, fastpath=True)
133 if copy:
134 data = data.copy()
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, block, axis, do_integrity_check, fast
path)
3413 block = block[0]
3414 if not isinstance(block, Block):
-> 3415 block = make_block(block, axis, axis, ndim=1, fastpath=True)
3416
3417 else:
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in make_block(values, items, ref_items, klass, ndim, dt
ype, fastpath, placement)
1893
1894 return klass(values, items, ref_items, ndim=ndim, fastpath=fastpath,
-> 1895 placement=placement)
1896
1897
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
1297 super(ObjectBlock, self).__init__(values, items, ref_items, ndim=ndim,
1298 fastpath=fastpath,
-> 1299 placement=placement)
1300
1301 @property
C:\python_envs\prod2\lib\site-packages\pandas\core\internals.pyc in __init__(self, values, items, ref_items, ndim, fastp
ath, placement)
63 if len(items) != len(values):
64 raise ValueError('Wrong number of items passed %d, indices imply '
---> 65 '%d' % (len(items), len(values)))
66
67 self.set_ref_locs(placement)
ValueError: Wrong number of items passed 1, indices imply 0
</code></pre></div> | <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
ind = ['A', 'A', 'B', 'C']i
df = pd.DataFrame({'test':range(len(ind))}, index=ind)
rows = ['C', 'B']
res = df.ix[rows]
assert rows == list(res.index) # fails"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-s1">ind</span> <span class="pl-c1">=</span> [<span class="pl-s">'A'</span>, <span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>, <span class="pl-s">'C'</span>]<span class="pl-s1">i</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'test'</span>:<span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">ind</span>))}, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">ind</span>)
<span class="pl-s1">rows</span> <span class="pl-c1">=</span> [<span class="pl-s">'C'</span>, <span class="pl-s">'B'</span>]
<span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">ix</span>[<span class="pl-s1">rows</span>]
<span class="pl-k">assert</span> <span class="pl-s1">rows</span> <span class="pl-c1">==</span> <span class="pl-en">list</span>(<span class="pl-s1">res</span>.<span class="pl-s1">index</span>) <span class="pl-c"># fails</span></pre></div>
<p dir="auto">The problem is that the resulting DataFrame keeps the ordering of the <code class="notranslate">df.index</code> and not the <code class="notranslate">rows</code> key. You'll notice that the <code class="notranslate">rows</code> key doesn't reference a duplicate value.</p> | 0 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen" rel="nofollow">Sam Brannen</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9861?redirect=false" rel="nofollow">SPR-9861</a></strong> and commented</p>
<h4 dir="auto">Status Quo</h4>
<p dir="auto">When using SpEL's type function <code class="notranslate">T</code> to access a static constant, evaluation of the expression fails if the class referenced by the <code class="notranslate">T</code> function implements <code class="notranslate">java.util.Map</code>.</p>
<p dir="auto">For example, the following SpEL expression (taken from an excerpt from a project using Spring Integration) fails:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<header name="#{T(org.springframework.integration.MessageHeaders).CORRELATION_ID}" value="foo" />"><pre class="notranslate"><<span class="pl-ent">header</span> <span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">"</span>#{T(org.springframework.integration.MessageHeaders).CORRELATION_ID}<span class="pl-pds">"</span></span> <span class="pl-e">value</span>=<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span> /></pre></div>
<p dir="auto">... with the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.util.Map
at org.springframework.context.expression.MapAccessor.canRead(MapAccessor.java:37)
at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:190)
at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:139)
... 47 more"><pre class="notranslate"><code class="notranslate">Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.util.Map
at org.springframework.context.expression.MapAccessor.canRead(MapAccessor.java:37)
at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:190)
at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:139)
... 47 more
</code></pre></div>
<hr>
<h4 dir="auto">Analysis</h4>
<p dir="auto">The reason for the above exception is that Spring Integration's <code class="notranslate">MessageHeaders</code> class implements <code class="notranslate">java.util.Map</code>. Thus the SpEL <code class="notranslate">MapAccessor</code> is added to the list of <em>candidate</em> property accessors to try in <code class="notranslate">PropertyOrFieldReference.getPropertyAccessorsToTry(Class<?>, ExpressionState)</code>, and <code class="notranslate">MapAccessor</code> ends up in the candidate list <strong>before</strong> <code class="notranslate">ReflectivePropertyAccessor</code>.</p>
<p dir="auto">So, when the expression is evaluated, it fails since the <code class="notranslate">T()</code> function returns a class instead of a <code class="notranslate">Map</code> instance. In other words, the <code class="notranslate">MapAccessor</code> assumes it is being passed an instance of <code class="notranslate">java.util.Map</code>, when it in fact receives an instance of <code class="notranslate">java.lang.Class</code> (i.e., the class reference returned by the <code class="notranslate">T()</code> function).</p>
<p dir="auto">In summary, <code class="notranslate">MapAccessor</code> obviously cannot be used to access static members. Thus the current implementation is completely broken in that the building of the candidate property accessor list does not take into account that the eventual property access may be <em>static</em>.</p>
<hr>
<h4 dir="auto">Deliverables</h4>
<ol dir="auto">
<li>Ensure that static members (i.e., constants) can be accessed in SpEL expressions using the <code class="notranslate">T()</code> function when the class passed to the <code class="notranslate">T()</code> function implements <code class="notranslate">java.util.Map</code>.</li>
</ol>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398167005" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16232" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16232/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16232">#16232</a> Referencing static field of class that extends Map in expression language causes class cast exception (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Backported to:</strong> <a href="https://github.com/spring-projects/spring-framework/milestone/97?closed=1">3.2.9</a></p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=paul4christ79" rel="nofollow">Paul Benedict</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4625?redirect=false" rel="nofollow">SPR-4625</a></strong> and commented</p>
<p dir="auto">It is sometimes desirable to perform a single operation in a separate session. For instance, if a DataIntegrityViolationException is returned in the current transaction, go back to the database to determine which column was duplicated. But for this to succeed, a separate session is required because Hibernate does not allow flushing, which is predicated by the aforementioned query.</p>
<p dir="auto"><a href="http://forum.springframework.org/archive/index.php/t-27112.html" rel="nofollow">http://forum.springframework.org/archive/index.php/t-27112.html</a></p>
<p dir="auto">Thus, I propose an extra method to complement execute or executeFind that would (use SessionFactoryUtils) to perform work in a separate session.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.2</p> | 0 |
<p dir="auto">If I have <code class="notranslate">abstract Foo</code> and <code class="notranslate">type Bar<:Foo ... end</code>, <code class="notranslate">type Baz<:Foo ... end</code>, how should I denote a <code class="notranslate">Vector</code> accepting only any <em>subtypes themselves</em> (not instances) of <code class="notranslate">Foo</code> type?</p>
<p dir="auto">This trick works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="typealias FooType{T<:Foo} Type{T}
v = Vector{FooType}
push!(v, Bar)
push!(v, Baz)
push!(v, Real) # throws an error as expected"><pre class="notranslate"><code class="notranslate">typealias FooType{T<:Foo} Type{T}
v = Vector{FooType}
push!(v, Bar)
push!(v, Baz)
push!(v, Real) # throws an error as expected
</code></pre></div>
<p dir="auto">But it would be nice to express that in-place, like <code class="notranslate">Vector{Type{T<:Component}{T}}</code> (not sure about concrete syntax, but you've got an idea)</p> | <p dir="auto">Currently, there is the following line in the sparse matmult code:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/JuliaLang/julia/blob/056b374919e11977d5a8d57b446ad1c72f3e6b1d/base/sparse/linalg.jl#L94-L95">julia/base/sparse/linalg.jl</a>
</p>
<p class="mb-0 color-fg-muted">
Lines 94 to 95
in
<a data-pjax="true" class="commit-tease-sha" href="/JuliaLang/julia/commit/056b374919e11977d5a8d57b446ad1c72f3e6b1d">056b374</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L94" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="94"></td>
<td id="LC94" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> For compatibility with dense multiplication API. Should be deleted when dense multiplication</span> </td>
</tr>
<tr class="border-0">
<td id="L95" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="95"></td>
<td id="LC95" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">#</span> API is updated to follow BLAS API.</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">I am assuming that this means we want to have the more general <code class="notranslate">A_mul_B*!(α,A,B,β,C) = αAB + βC</code> methods which overwrite <code class="notranslate">C</code> (the BLAS <code class="notranslate">gemm</code> API) for dense arrays. Is that still the case? (It also seems possible to keep both APIs, i.e. keep the <code class="notranslate">A_mul_B*!(C,A,B)</code> methods, which would simply be defined as <code class="notranslate">A_mul_B*!(C,A,B) = A_mul_B*!(1,A,B,0,C)</code>.)</p>
<p dir="auto">I would personally like to have the <code class="notranslate">gemm</code> API defined for all array types (this has been expressed <a href="https://github.com/JuliaLang/julia/issues/5332#issuecomment-40901008" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/5332/hovercard">elsewhere</a>). Implementing these methods for dense arrays seems fairly simple, since they would just directly call <code class="notranslate">gemm</code> et al. The sparse case is already implemented. The only real modification would be to the pure julia <a href="https://github.com/JuliaLang/julia/blob/056b374919e11977d5a8d57b446ad1c72f3e6b1d/base/linalg/matmul.jl#L486">generic matmult</a>, which does not accept <code class="notranslate">α</code> and <code class="notranslate">β</code> arguments.</p>
<p dir="auto">This would lead to generic code that works with any type of array/number. I currently have a simple implementation of expm (after having done the modification to <code class="notranslate">_generic_matmatmult!</code>) which works with bigfloats and sparse arrays.</p> | 0 |
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<p dir="auto">Execute this code in a terminal with width <= 90 cols.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
val = [1017.56, 88.0502014, 114.90493799999999, 98.52555079999999, -4.35584164,
0.13409058699999998, -3.28222513, 0.137214884, -3.23924017, 0.08030553160000001,
25.4253311, 4.71156263, 4.71156263, 4.71148443, 0.725787282, 0.861985624,
0.488319486, 0.221756965, 0.491590142, 0.174637929, 0.14585168699999998,
0.8847839829999999, pd.Timestamp('2018-05-08 20:07:23.560000')]
col_id = pd.MultiIndex(levels=[['A', 'B', 'C', 'D', 'E', 'F'],
['0', '1', '2', '3', '4', '5', '6', '7', 'a', 'act', 'axl', 'b', 'c', 'top', ''],
['a', 'b', 'c', '']],
labels=[[4, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 5],
[-1, 8, 11, 12, 10, 13, 10, 13, 10, 13, -1, 9, 9, 9, 0, 1, 2, 3, 4, 5, 6, 7, 14],
[-1, -1, -1, -1, 0, 0, 1, 1, 2, 2, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, 3]])
row_id = pd.MultiIndex.from_tuples(
[('rotation', '0', pd.Timedelta('0 days 01:20:01.807984'))])
df = pd.DataFrame(data=val).transpose()
df.index = row_id
df.columns = col_id
print(df)
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-s1">val</span> <span class="pl-c1">=</span> [<span class="pl-c1">1017.56</span>, <span class="pl-c1">88.0502014</span>, <span class="pl-c1">114.90493799999999</span>, <span class="pl-c1">98.52555079999999</span>, <span class="pl-c1">-</span><span class="pl-c1">4.35584164</span>,
<span class="pl-c1">0.13409058699999998</span>, <span class="pl-c1">-</span><span class="pl-c1">3.28222513</span>, <span class="pl-c1">0.137214884</span>, <span class="pl-c1">-</span><span class="pl-c1">3.23924017</span>, <span class="pl-c1">0.08030553160000001</span>,
<span class="pl-c1">25.4253311</span>, <span class="pl-c1">4.71156263</span>, <span class="pl-c1">4.71156263</span>, <span class="pl-c1">4.71148443</span>, <span class="pl-c1">0.725787282</span>, <span class="pl-c1">0.861985624</span>,
<span class="pl-c1">0.488319486</span>, <span class="pl-c1">0.221756965</span>, <span class="pl-c1">0.491590142</span>, <span class="pl-c1">0.174637929</span>, <span class="pl-c1">0.14585168699999998</span>,
<span class="pl-c1">0.8847839829999999</span>, <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-s">'2018-05-08 20:07:23.560000'</span>)]
<span class="pl-s1">col_id</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>(<span class="pl-s1">levels</span><span class="pl-c1">=</span>[[<span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>, <span class="pl-s">'C'</span>, <span class="pl-s">'D'</span>, <span class="pl-s">'E'</span>, <span class="pl-s">'F'</span>],
[<span class="pl-s">'0'</span>, <span class="pl-s">'1'</span>, <span class="pl-s">'2'</span>, <span class="pl-s">'3'</span>, <span class="pl-s">'4'</span>, <span class="pl-s">'5'</span>, <span class="pl-s">'6'</span>, <span class="pl-s">'7'</span>, <span class="pl-s">'a'</span>, <span class="pl-s">'act'</span>, <span class="pl-s">'axl'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'top'</span>, <span class="pl-s">''</span>],
[<span class="pl-s">'a'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">''</span>]],
<span class="pl-s1">labels</span><span class="pl-c1">=</span>[[<span class="pl-c1">4</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">3</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">5</span>],
[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">8</span>, <span class="pl-c1">11</span>, <span class="pl-c1">12</span>, <span class="pl-c1">10</span>, <span class="pl-c1">13</span>, <span class="pl-c1">10</span>, <span class="pl-c1">13</span>, <span class="pl-c1">10</span>, <span class="pl-c1">13</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">9</span>, <span class="pl-c1">9</span>, <span class="pl-c1">9</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>, <span class="pl-c1">7</span>, <span class="pl-c1">14</span>],
[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">3</span>]])
<span class="pl-s1">row_id</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_tuples</span>(
[(<span class="pl-s">'rotation'</span>, <span class="pl-s">'0'</span>, <span class="pl-s1">pd</span>.<span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 01:20:01.807984'</span>))])
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">val</span>).<span class="pl-en">transpose</span>()
<span class="pl-s1">df</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">row_id</span>
<span class="pl-s1">df</span>.<span class="pl-s1">columns</span> <span class="pl-c1">=</span> <span class="pl-s1">col_id</span>
<span class="pl-en">print</span>(<span class="pl-s1">df</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">When trying to print a dataframe, if the values contained in the indexes and/or in the first/last column are too long and the terminal too narrow, an IndexError is raised:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/pandas/core/base.py", line 61, in __str__
return self.__unicode__()
File "/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py", line 663, in __unicode__
line_width=width, show_dimensions=show_dimensions)
File "/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py", line 1968, in to_string
formatter.to_string()
File "/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py", line 648, in to_string
strcols = self._to_str_columns()
File "/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py", line 539, in _to_str_columns
str_columns = self._get_formatted_column_labels(frame)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py", line 782, in _get_formatted_column_labels
str_columns = _sparsify(str_columns)
File "/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/multi.py", line 2962, in _sparsify
prev = pivoted[start]
IndexError: list index out of range"><pre class="notranslate"><span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):
<span class="pl-v">File</span> <span class="pl-s">"<stdin>"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</span>, <span class="pl-s1">in</span> <span class="pl-c1"><</span><span class="pl-s1">module</span><span class="pl-c1">></span>
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/core/base.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">61</span>, <span class="pl-s1">in</span> <span class="pl-s1">__str__</span>
<span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">__unicode__</span>()
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">663</span>, <span class="pl-s1">in</span> <span class="pl-s1">__unicode__</span>
<span class="pl-s1">line_width</span><span class="pl-c1">=</span><span class="pl-s1">width</span>, <span class="pl-s1">show_dimensions</span><span class="pl-c1">=</span><span class="pl-s1">show_dimensions</span>)
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1968</span>, <span class="pl-s1">in</span> <span class="pl-s1">to_string</span>
<span class="pl-s1">formatter</span>.<span class="pl-en">to_string</span>()
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">648</span>, <span class="pl-s1">in</span> <span class="pl-s1">to_string</span>
<span class="pl-s1">strcols</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_to_str_columns</span>()
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">539</span>, <span class="pl-s1">in</span> <span class="pl-s1">_to_str_columns</span>
<span class="pl-s1">str_columns</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_get_formatted_column_labels</span>(<span class="pl-s1">frame</span>)
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">782</span>, <span class="pl-s1">in</span> <span class="pl-s1">_get_formatted_column_labels</span>
<span class="pl-s1">str_columns</span> <span class="pl-c1">=</span> <span class="pl-en">_sparsify</span>(<span class="pl-s1">str_columns</span>)
<span class="pl-v">File</span> <span class="pl-s">"/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/multi.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2962</span>, <span class="pl-s1">in</span> <span class="pl-s1">_sparsify</span>
<span class="pl-s1">prev</span> <span class="pl-c1">=</span> <span class="pl-s1">pivoted</span>[<span class="pl-s1">start</span>]
<span class="pl-v">IndexError</span>: <span class="pl-s1">list</span> <span class="pl-s1">index</span> <span class="pl-s1">out</span> <span class="pl-s1">of</span> <span class="pl-s1">range</span></pre></div>
<p dir="auto">This happens because <code class="notranslate">pandas.io.formats.format.DataFrameFormatter._chk_truncate()</code> gives an empty frame. Subsequently, an empty <code class="notranslate">str_columns</code> is passed to <code class="notranslate">pandas.core.indexes.multi._sparsify(*args)</code> which raises the <code class="notranslate">IndexError</code> when trying to access the passed variable.</p>
<p dir="auto">This problem seems to arise only when the dataframe and its index contains <code class="notranslate">datetime</code>-like values (see example with long strings in next section).</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">The raised exception is misleading, since the user could think his/her dataframe has something wrong, whereas only the size of the terminal is too narrow. A proper slicing of the string version of datetime formats in order to fit the terminal size would be the expected output.</p>
<p dir="auto">With strings, this works better than with datetime. The following code does not raise any Exception:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
n = 10
rng = pd.date_range('22/12/2018', periods=n, freq='H')
id_1 = ["i am a really long string"]*n
["Lorem ipsum dolor sit amet, consectetur adipiscing elit"+str(i) for i in range(n)]
ids = pd.MultiIndex.from_tuples(list(zip(id_1,id_2,rng)))
df = pd.DataFrame([rng,rng]).transpose()
df.index = ids
print(df)
"><pre class="notranslate"><span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span>
<span class="pl-s1">rng</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'22/12/2018'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-s1">n</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'H'</span>)
<span class="pl-s1">id_1</span> <span class="pl-c1">=</span> [<span class="pl-s">"i am a really long string"</span>]<span class="pl-c1">*</span><span class="pl-s1">n</span>
[<span class="pl-s">"Lorem ipsum dolor sit amet, consectetur adipiscing elit"</span><span class="pl-c1">+</span><span class="pl-en">str</span>(<span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">n</span>)]
<span class="pl-s1">ids</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_tuples</span>(<span class="pl-en">list</span>(<span class="pl-en">zip</span>(<span class="pl-s1">id_1</span>,<span class="pl-s1">id_2</span>,<span class="pl-s1">rng</span>)))
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>([<span class="pl-s1">rng</span>,<span class="pl-s1">rng</span>]).<span class="pl-en">transpose</span>()
<span class="pl-s1">df</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">ids</span>
<span class="pl-en">print</span>(<span class="pl-s1">df</span>)</pre></div>
<p dir="auto">Otherwise, a warning with an explanation should be raised if the frame that has to be printed gets truncated to an empty one.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.5.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.15.0-22-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.23.0<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 39.2.0<br>
Cython: 0.28.3<br>
numpy: 1.14.3<br>
scipy: 1.1.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.4.0<br>
sphinx: 1.6.7<br>
patsy: None<br>
dateutil: 2.7.3<br>
pytz: 2018.4<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.2.2<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999999999<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | <h4 dir="auto">Code example</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np
index = pd.date_range('1970', '2018', freq='A')
data = np.random.randn(len(index))
columns1 = [
['This is a long title with > 37 chars.'],
['cat'],
]
columns2 = [
['This is a loooooonger title with > 43 chars.'],
['dog'],
]
df1 = pd.DataFrame(data=data, index=index, columns=columns1)
df2 = pd.DataFrame(data=data, index=index, columns=columns2)
df = pd.concat([df1, df2], axis=1)
df.head()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'1970'</span>, <span class="pl-s">'2018'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'A'</span>)
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-en">len</span>(<span class="pl-s1">index</span>))
<span class="pl-s1">columns1</span> <span class="pl-c1">=</span> [
[<span class="pl-s">'This is a long title with > 37 chars.'</span>],
[<span class="pl-s">'cat'</span>],
]
<span class="pl-s1">columns2</span> <span class="pl-c1">=</span> [
[<span class="pl-s">'This is a loooooonger title with > 43 chars.'</span>],
[<span class="pl-s">'dog'</span>],
]
<span class="pl-s1">df1</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">data</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">index</span>, <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">columns1</span>)
<span class="pl-s1">df2</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">data</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">index</span>, <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">columns2</span>)
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">df1</span>, <span class="pl-s1">df2</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">df</span>.<span class="pl-en">head</span>()</pre></div>
<h4 dir="auto">Output (using pandas 0.23.0)</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> df.head()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/base.py", line 82, in __repr__
return str(self)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/base.py", line 61, in __str__
return self.__unicode__()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/frame.py", line 663, in __unicode__
line_width=width, show_dimensions=show_dimensions)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/frame.py", line 1968, in to_string
formatter.to_string()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 648, in to_string
strcols = self._to_str_columns()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 539, in _to_str_columns
str_columns = self._get_formatted_column_labels(frame)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 782, in _get_formatted_column_labels
str_columns = _sparsify(str_columns)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/indexes/multi.py", line 2962, in _sparsify
prev = pivoted[start]
IndexError: list index out of range"><pre class="notranslate"><code class="notranslate">>>> df.head()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/base.py", line 82, in __repr__
return str(self)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/base.py", line 61, in __str__
return self.__unicode__()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/frame.py", line 663, in __unicode__
line_width=width, show_dimensions=show_dimensions)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/frame.py", line 1968, in to_string
formatter.to_string()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 648, in to_string
strcols = self._to_str_columns()
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 539, in _to_str_columns
str_columns = self._get_formatted_column_labels(frame)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/io/formats/format.py", line 782, in _get_formatted_column_labels
str_columns = _sparsify(str_columns)
File "/home/david/.virtualenvs/thegrid-py3-venv/lib/python3.5/site-packages/pandas/core/indexes/multi.py", line 2962, in _sparsify
prev = pivoted[start]
IndexError: list index out of range
</code></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">After upgrading Pandas 0.22.0 to 0.23.0 I have experienced the above error. I have noticed that it is the length of the column values, <code class="notranslate">This is a long title with > 37 chars.</code> and <code class="notranslate">This is a loooooonger title with > 43 chars.</code>, that makes the difference. If I tweak the combined length of these to be <= 80 characters, there is no error, and output is as expected.</p>
<h4 dir="auto">Expected Output (using pandas 0.22.0)</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> df.head()
This is a long title with > 37 chars. \
cat
1970-12-31 -1.448415
1971-12-31 0.081324
1972-12-31 -0.018105
1973-12-31 0.902790
1974-12-31 0.668474
This is a loooooonger title with > 43 chars.
dog
1970-12-31 -1.448415
1971-12-31 0.081324
1972-12-31 -0.018105
1973-12-31 0.902790
1974-12-31 0.668474"><pre class="notranslate"><code class="notranslate">>>> df.head()
This is a long title with > 37 chars. \
cat
1970-12-31 -1.448415
1971-12-31 0.081324
1972-12-31 -0.018105
1973-12-31 0.902790
1974-12-31 0.668474
This is a loooooonger title with > 43 chars.
dog
1970-12-31 -1.448415
1971-12-31 0.081324
1972-12-31 -0.018105
1973-12-31 0.902790
1974-12-31 0.668474
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.2.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.4.0-124-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_ZA.UTF-8<br>
LOCALE: en_ZA.UTF-8</p>
<p dir="auto">pandas: 0.23.0<br>
pytest: None<br>
pip: 10.0.1<br>
setuptools: 32.3.1<br>
Cython: None<br>
numpy: 1.14.0<br>
scipy: None<br>
pyarrow: None<br>
xarray: None<br>
IPython: None<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2018.3<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: None<br>
openpyxl: 2.5.3<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: 1.0.4<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.7.4 (dt dec pq3 ext lo64)<br>
jinja2: None<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | 1 |
<p dir="auto">I'm trying to request google search results and access the top few links. However, it always gets stuck on some sites. Ctrl-C is not in effect but Ctrl-Z does bring me to the terminal.</p>
<p dir="auto">I have set a timeout for each request.<br>
I have read messages that DNS is one of the sources of blocking and I patched this with an HTTP adapter.<br>
It seems that the requests library is using blocking TCP connection(not sure), where the program has no control over the timeout if the underlying implementation does not return.</p>
<p dir="auto">In another scenario, the connection is perfectly slow or the page is unexpected too big such that this connection keeps forever. This case is obviously not a bug but a vulnerability that can be used to anti-spider.</p>
<p dir="auto">I would like to set a hard limit for my connection, regardless of DNS, TCP handshaking time, TLS handshaking time, or uploading/downloading time, and at any time I would like to exit, I just enter Ctrl-C. This can be done by using requests in another thread(POSIX thread)/process, ungracefully.</p>
<p dir="auto">My program just stuck again.</p> | <p dir="auto">The request <code class="notranslate">my_session.head(some_url, verify=True)</code> reuses existing connections, including any that were established with <code class="notranslate">verify=False</code>.</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">I would expect that HTTP requests with <code class="notranslate">verify=True</code> would only reuse existing connections that were also established with <code class="notranslate">verify=True</code>.</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">From my test-case, it seems that the session will reuse an existing connection, irrespective of how that connection was established.</p>
<h2 dir="auto">Reproduction Steps</h2>
<p dir="auto">The following code should demonstrate the problem.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
from urllib3.exceptions import (MaxRetryError, SSLError)
def do_head_request_on(strategy, verify):
try:
r = strategy.head("https://wrong.host.badssl.com/",
verify=verify)
print("With verify %s,\tHTTP request made OK." % verify)
except requests.exceptions.ConnectionError as ce:
cause = ce.__context__
if type(cause) is MaxRetryError:
cause = cause.reason
if type(cause) is SSLError:
print("With verify %s,\tTLS problem" % verify)
else:
raise ce
requests.packages.urllib3.disable_warnings()
print("NOT using sessions:")
do_head_request_on(requests, True)
do_head_request_on(requests, False)
do_head_request_on(requests, True)
session = requests.Session()
print("\nUSING sessions:")
do_head_request_on(session, True)
do_head_request_on(session, False)
do_head_request_on(session, True)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">from</span> <span class="pl-s1">urllib3</span>.<span class="pl-s1">exceptions</span> <span class="pl-k">import</span> (<span class="pl-v">MaxRetryError</span>, <span class="pl-v">SSLError</span>)
<span class="pl-k">def</span> <span class="pl-en">do_head_request_on</span>(<span class="pl-s1">strategy</span>, <span class="pl-s1">verify</span>):
<span class="pl-k">try</span>:
<span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-s1">strategy</span>.<span class="pl-en">head</span>(<span class="pl-s">"https://wrong.host.badssl.com/"</span>,
<span class="pl-s1">verify</span><span class="pl-c1">=</span><span class="pl-s1">verify</span>)
<span class="pl-en">print</span>(<span class="pl-s">"With verify %s,<span class="pl-cce">\t</span>HTTP request made OK."</span> <span class="pl-c1">%</span> <span class="pl-s1">verify</span>)
<span class="pl-k">except</span> <span class="pl-s1">requests</span>.<span class="pl-s1">exceptions</span>.<span class="pl-v">ConnectionError</span> <span class="pl-k">as</span> <span class="pl-s1">ce</span>:
<span class="pl-s1">cause</span> <span class="pl-c1">=</span> <span class="pl-s1">ce</span>.<span class="pl-s1">__context__</span>
<span class="pl-k">if</span> <span class="pl-en">type</span>(<span class="pl-s1">cause</span>) <span class="pl-c1">is</span> <span class="pl-v">MaxRetryError</span>:
<span class="pl-s1">cause</span> <span class="pl-c1">=</span> <span class="pl-s1">cause</span>.<span class="pl-s1">reason</span>
<span class="pl-k">if</span> <span class="pl-en">type</span>(<span class="pl-s1">cause</span>) <span class="pl-c1">is</span> <span class="pl-v">SSLError</span>:
<span class="pl-en">print</span>(<span class="pl-s">"With verify %s,<span class="pl-cce">\t</span>TLS problem"</span> <span class="pl-c1">%</span> <span class="pl-s1">verify</span>)
<span class="pl-k">else</span>:
<span class="pl-k">raise</span> <span class="pl-s1">ce</span>
<span class="pl-s1">requests</span>.<span class="pl-s1">packages</span>.<span class="pl-s1">urllib3</span>.<span class="pl-en">disable_warnings</span>()
<span class="pl-en">print</span>(<span class="pl-s">"NOT using sessions:"</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">requests</span>, <span class="pl-c1">True</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">requests</span>, <span class="pl-c1">False</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">requests</span>, <span class="pl-c1">True</span>)
<span class="pl-s1">session</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-v">Session</span>()
<span class="pl-en">print</span>(<span class="pl-s">"<span class="pl-cce">\n</span>USING sessions:"</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">session</span>, <span class="pl-c1">True</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">session</span>, <span class="pl-c1">False</span>)
<span class="pl-en">do_head_request_on</span>(<span class="pl-s1">session</span>, <span class="pl-c1">True</span>)</pre></div>
<p dir="auto">Here is the output on my machine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="NOT using sessions:
With verify True, TLS problem
With verify False, HTTP request made OK.
With verify True, TLS problem
USING sessions:
With verify True, TLS problem
With verify False, HTTP request made OK.
With verify True, HTTP request made OK."><pre class="notranslate"><code class="notranslate">NOT using sessions:
With verify True, TLS problem
With verify False, HTTP request made OK.
With verify True, TLS problem
USING sessions:
With verify True, TLS problem
With verify False, HTTP request made OK.
With verify True, HTTP request made OK.
</code></pre></div>
<p dir="auto">The issue is that the final request has <code class="notranslate">verify=True</code> against a known-bad endpoint; however, the request is successful.</p>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"chardet": {
"version": "4.0.0"
},
"cryptography": {
"version": "37.0.4"
},
"idna": {
"version": "2.10"
},
"implementation": {
"name": "CPython",
"version": "3.9.2"
},
"platform": {
"release": "5.10.0-18-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "30000050",
"version": "22.0.0"
},
"requests": {
"version": "2.25.1"
},
"system_ssl": {
"version": "101010ef"
},
"urllib3": {
"version": "1.26.5"
},
"using_pyopenssl": true
}"><pre class="notranslate">{
<span class="pl-ent">"chardet"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>4.0.0<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"cryptography"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>37.0.4<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"idna"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.10<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"implementation"</span>: {
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>CPython<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.9.2<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"platform"</span>: {
<span class="pl-ent">"release"</span>: <span class="pl-s"><span class="pl-pds">"</span>5.10.0-18-amd64<span class="pl-pds">"</span></span>,
<span class="pl-ent">"system"</span>: <span class="pl-s"><span class="pl-pds">"</span>Linux<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"pyOpenSSL"</span>: {
<span class="pl-ent">"openssl_version"</span>: <span class="pl-s"><span class="pl-pds">"</span>30000050<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>22.0.0<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"requests"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.25.1<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"system_ssl"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>101010ef<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"urllib3"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.26.5<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"using_pyopenssl"</span>: <span class="pl-c1">true</span>
}</pre></div> | 0 |
<p dir="auto">It is not always does like this. But some of txt files fails. Plus, if i copy all types from NotePad and past it Atom it will be fixed.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7994408/6997882/8d3654c2-dbd6-11e4-9a8e-908b32ae9e3e.PNG"><img src="https://cloud.githubusercontent.com/assets/7994408/6997882/8d3654c2-dbd6-11e4-9a8e-908b32ae9e3e.PNG" alt="atom issue" style="max-width: 100%;"></a></p>
<p dir="auto">after copy all from NotePad<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7994408/6997895/ff18af86-dbd6-11e4-857e-147d997ff387.PNG"><img src="https://cloud.githubusercontent.com/assets/7994408/6997895/ff18af86-dbd6-11e4-857e-147d997ff387.PNG" alt="fixed" style="max-width: 100%;"></a></p>
<p dir="auto">Atom : 0.189.0 | 02.04.2015 00:44:55</p> | <p dir="auto">sometimes a chinese-char become '���',(as we all know that in charset utf-8, a chinese-char need 3 byte )</p> | 1 |
<p dir="auto">The THREE.SVGLoader() is unable to process the attached SVG file. Since the file looks fine in Chrome Browser and other SVG editors, I assume the file conforms to the SVG standard. When the file is loaded to three.js, it does not crash anything, but it is rendered into gibberish.</p>
<p dir="auto">Is the problem caused by a bug in the SVGLoader?</p>
<p dir="auto"><a href="https://github.com/mrdoob/three.js/files/3935964/math.zip">math.zip</a></p> | <p dir="auto">I mean, I understand SVGLoader is work in progress, but can you really get anywhere without this? my svg looks exploded :)</p>
<p dir="auto">example:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<g transform="translate(226 226)">
<polygon fill="#F4F7FF" points="..."><pre class="notranslate"><<span class="pl-ent">g</span> <span class="pl-e">transform</span>=<span class="pl-s"><span class="pl-pds">"</span>translate(226 226)<span class="pl-pds">"</span></span>>
<<span class="pl-ent">polygon</span> <span class="pl-e">fill</span>=<span class="pl-s"><span class="pl-pds">"</span>#F4F7FF<span class="pl-pds">"</span></span> <span class="pl-e">points</span>=<span class="pl-s"><span class="pl-pds">"</span>...</span></pre></div>
<p dir="auto">in SVGLoader there is only this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="case 'g':
style = parseStyle( node, style );
break;"><pre class="notranslate"><span class="pl-s1">case</span> <span class="pl-s">'g'</span>:
<span class="pl-s1">style</span> <span class="pl-c1">=</span> <span class="pl-en">parseStyle</span><span class="pl-kos">(</span> <span class="pl-s1">node</span><span class="pl-kos">,</span> <span class="pl-s1">style</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">break</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">while funcs like <code class="notranslate">parseTransformNode</code> are clearly there already</p> | 1 |
<h5 dir="auto">System information (version)</h5>
<p dir="auto">Using the cv2 libraray in a python3.6 application, when I try to set the preferable target to CUDA using the line <code class="notranslate">cv.dnn_Net.setPreferableTarget(cv.dnn.DNN_TARGET_CUDA)</code> I get the following error;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: descriptor 'setPreferableTarget' requires a 'cv2.dnn_Net' object but received a 'int'"><pre class="notranslate"><code class="notranslate">TypeError: descriptor 'setPreferableTarget' requires a 'cv2.dnn_Net' object but received a 'int'
</code></pre></div>
<p dir="auto">I followed the 4.2 docs when determing the object to use when setting the target.</p>
<p dir="auto">Can't really determine if it's a bug or silly mistake.Everything else runs without issue.</p>
<h5 dir="auto">Steps to reproduce</h5> | <p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="224658849" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/8658" data-hovercard-type="issue" data-hovercard-url="/opencv/opencv/issues/8658/hovercard" href="https://github.com/opencv/opencv/issues/8658">#8658</a>. Linking any application that uses the OpenCV C API without optimizations now results in a undefined reference to cvRound. This is because this function is now defined ONLY in a C++-only header: fast_math.hpp.</p>
<p dir="auto">The reply (by "alalek") on that bug was that the C API shouldn't be used anymore. I don't know who alalek is; is this the official position? This issue effectively kills the C API. I.e. it's no longer an OPTION to use the C API without experiencing pain. And this particular issue isn't even hard to fix. I can give you a patch, and we can agree to at least not kill the C API on purpose, yes?</p> | 0 |
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">13.1.0</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Windows</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">19042.985</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">test.html should get loaded</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">electron crashes.</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><a href="https://gist.github.com/t57ser/591ace911d2274f5500a702d178d7b96">https://gist.github.com/t57ser/591ace911d2274f5500a702d178d7b96</a></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">After example.com gets loaded, open the devtools and type<br>
location = "test://"</p> | <h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">12.0.2<br>
"electron-packager": "^15.2.0",</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Windows</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">Windows 10 20H2</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Electron should not crash</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Electron crashes when adding iframe</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<p dir="auto"><a href="https://github.com/electron/electron/files/6211709/app.zip">app.zip</a></p>
<p dir="auto">I've the following component wich crashes electron:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export class SimpleReportViewer extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.container = document.createElement('div');
this.shadowRoot.appendChild(this.container);
}
loadIframe() {
if (this.isConnected) {
this._iframe = document.createElement("iframe");
this._iframe.style.width = "100%";
this._iframe.style.height = "100%";
this._iframe.src = '/iframe.html';
this.container.appendChild(this._iframe);
}
}
connectedCallback() {
this.loadIframe();
}
}
customElements.define('simple-report-viewer', SimpleReportViewer);"><pre class="notranslate"><code class="notranslate">export class SimpleReportViewer extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.container = document.createElement('div');
this.shadowRoot.appendChild(this.container);
}
loadIframe() {
if (this.isConnected) {
this._iframe = document.createElement("iframe");
this._iframe.style.width = "100%";
this._iframe.style.height = "100%";
this._iframe.src = '/iframe.html';
this.container.appendChild(this._iframe);
}
}
connectedCallback() {
this.loadIframe();
}
}
customElements.define('simple-report-viewer', SimpleReportViewer);
</code></pre></div> | 1 |
<p dir="auto">Create a new ContainerLayer type or an argument to a SceneBuilder.build() or SceneBuilder.pushScene() that allows the framework to explicitly raster cache the subtree right away so subsequent redraws of the scene are optimized.</p> | <h2 dir="auto">Use case</h2>
<p dir="auto">Although <a href="https://docs.flutter.io/flutter/widgets/RepaintBoundary-class.html" rel="nofollow">RepaintBoundary</a> is a key widget in improving Flutter’s performance on the UI thread, it’s not well-utilized on the GPU thread. For example, only the lowest-level <code class="notranslate">RepaintBoundary</code>, which corresponds to leaf-level engine PictureLayer, currently triggers the raster cache on the GPU thread. In certain scenarios, raster caching can make a big performance difference -- e.g., 20%-30% in our <em>home_scroll_perf average_frame_rasterizer_time_millis</em> benchmark.</p>
<p dir="auto">With the recent introduction of retained <a href="https://docs.flutter.io/flutter/dart-ui/EngineLayer-class.html" rel="nofollow">EngineLayer</a>s, we now have the opportunity to use <code class="notranslate">RepaintBoundary</code> to trigger more raster caching on the higher level <code class="notranslate">RepaintBoundary</code>. Similar to the recent opacity and PhysicalShapeLayer optimizations, we may be able to improve our performance by multiple times.</p>
<h2 dir="auto">Proposal</h2>
<p dir="auto">Add a <code class="notranslate">RasterCache</code> option to the <code class="notranslate">RepaintBoundary</code> widget, so the developer can decide when to engage the optimizations. This option is not only to override our current raster cache heuristics, which are not very smart or reliable, but also allows developers to elect to make the tradeoff between quality and speed themselves. For example, when there’s a rotation transformation above the RepaintBoundary, raster caching the whole <code class="notranslate">RepaintBoundary</code> means that we’re no longer drawing pixel-perfect graphics, but the performance gain may significantly outweigh the quality drop (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="383264765" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/24627" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/24627/hovercard" href="https://github.com/flutter/flutter/issues/24627">#24627</a>).</p>
<p dir="auto">Things to implement:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Write performance tests for the scenarios where we’d like to see improvements. This will guide our implementation and check our correctness and performance.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Add a <code class="notranslate">RasterCache</code> option to the <code class="notranslate">RepaintBoundary</code> widget and wire it up between the framework and the engine.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Enable the engine-side raster caching based on the option.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Document the feature, and update Github issues to reflect the performance improvement, to teach our developers how to do it themselves.</li>
</ul>
<p dir="auto">Proposed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/liyuqian/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/liyuqian">@liyuqian</a></p> | 1 |
<h3 dir="auto">Body</h3>
<p dir="auto">We have a kind request for all the contributors to the latest <a href="https://pypi.org/project/apache-airflow/2.3.3rc3/" rel="nofollow">Apache Airflow RC 2.3.3rc3</a>.</p>
<p dir="auto">Could you please help us to test the RC versions of Airflow?</p>
<p dir="auto">Please let us know in the comment if the issue is addressed in the latest RC.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/19702" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/19702/hovercard">Switch Markdown engine to markdown-it-py (#19702)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/torbjornvatn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/torbjornvatn">@torbjornvatn</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/16435" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/16435/hovercard">Switch Markdown engine to markdown-it-py (#16435)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/21106" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/21106/hovercard">Fix StatD timing metric units (#21106)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/viktorvia/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/viktorvia">@viktorvia</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/20804" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/20804/hovercard">Some timing metrics are in seconds but reported as milliseconds (#20804)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23071" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23071/hovercard">Parse error for task added to multiple groups (#23071)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wolfier/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wolfier">@wolfier</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/14864" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/14864/hovercard">Using TaskGroup without context manager (Graph view visual bug) (#14864)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23113" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23113/hovercard">Check bag DAG schedule_interval match tiemtable (#23113)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sdebruyn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sdebruyn">@sdebruyn</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23087" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23087/hovercard">Show DAG parse error if 'timetable' and 'schedule_interval' are set together (#23087)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/23360" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23360/hovercard">Allow for LOGGING_LEVEL=DEBUG (#23360)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/GApfel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/GApfel">@GApfel</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23452" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23452/hovercard">Fix closing connection dbapi.get_pandas_df (#23452)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bauerfranz/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bauerfranz">@bauerfranz</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hubert-pietron/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hubert-pietron">@hubert-pietron</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/22947" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/22947/hovercard">closing connection chunks in DbApiHook.get_pandas_df (#22947)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23510" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23510/hovercard">Fix permission issue for dag that has dot in name (#23510)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23647" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23647/hovercard">ExternalTaskSensor respects soft_fail if the external task enters a failed_state (#23647)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/argibbs/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/argibbs">@argibbs</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexbegg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alexbegg">@alexbegg</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/19754" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/19754/hovercard">ExternalTaskSensor should skip if soft_fail=True and external task in one of the failed_states (#19754)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23667" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23667/hovercard">Fix mapped task immutability after clear (#23667)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23779" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23779/hovercard">Maintain grid view selection on filtering upstream (#23779)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23797" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23797/hovercard">Add TaskInstance State 'REMOVED' to finished states and success states (#23797)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23846" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23846/hovercard">Do not fail requeued TIs (#23846)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/malthe/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/malthe">@malthe</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tanelk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tanelk">@tanelk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23824" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23824/hovercard">Race condition between Triggerer and Scheduler (#23824)</a></li>
<li><a href="https://github.com/apache/airflow/pull/21316" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/21316/hovercard">Fix race condition between triggerer and scheduler (#21316)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/23860" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23860/hovercard">Remove special serde logic for mapped op_kwargs (#23860)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/erdos2n/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/erdos2n">@erdos2n</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23833" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23833/hovercard">Dynamic Task Mapping not working with op_kwargs in PythonOperator (#23833)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23934" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23934/hovercard">Grid fix details button truncated and small UI tweaks (#23934)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pierrejeambrun/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pierrejeambrun">@pierrejeambrun</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/23983" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23983/hovercard">Replace <code class="notranslate">use_task_execution_date</code> with <code class="notranslate">use_task_logical_date</code> (#23983)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eladkal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eladkal">@eladkal</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24048" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24048/hovercard">Drop Python 3.6 compatibility objects/modules (#24048)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Taragolis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Taragolis">@Taragolis</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24050" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24050/hovercard">Removing magic numbers from api_connecxion (#24050)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bernardocouto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bernardocouto">@bernardocouto</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24065" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24065/hovercard">Rename Permissions to Permission Pairs. (#24065)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zachliu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zachliu">@zachliu</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gbonazzoli/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gbonazzoli">@gbonazzoli</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jhtimmins/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jhtimmins">@jhtimmins</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23512" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23512/hovercard">Random "duplicate key value violates unique constraint" errors when initializing the postgres database (#23512)</a></li>
<li><a href="https://github.com/apache/airflow/issues/23926" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23926/hovercard">Airflow 2.3.1 - gunicorn keeps removing and adding Permission menu access on Permissions to role Admin (#23926)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24071" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24071/hovercard">Handle occasional deadlocks in trigger with retries (#24071)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/humit0/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/humit0">@humit0</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23639" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23639/hovercard">Triggerer process die with DB Deadlock (#23639)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24083" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24083/hovercard">Reduce grid view API calls (#24083)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24093" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24093/hovercard">Unify return_code interface for task runner (#24093)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pingzh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pingzh">@pingzh</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24095" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24095/hovercard">Do not support MSSQL less than v2017 in code (#24095)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24114" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24114/hovercard">Refactor <code class="notranslate">DagRun.verify_integrity</code> (#24114)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24117" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24117/hovercard">Don't crash scheduler if exec config has old k8s objects (#24117)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/patryk126p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/patryk126p">@patryk126p</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23727" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23727/hovercard">Airflow 2.3 scheduler error: 'V1Container' object has no attribute '_startup_probe' (#23727)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24152" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24152/hovercard">Fix useTasks crash on error (#24152)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24153" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24153/hovercard">Apply per-run log templates to log handlers (#24153)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24166" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24166/hovercard">Prevent dag dependencies page from crashing (#24166)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24186" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24186/hovercard">Update 'rich' to latest version across the board. (#24186)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24253" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24253/hovercard">ScheduleInterval nullable true added in openapi spec (#24253)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/omarsmak/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/omarsmak">@omarsmak</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Bowrna/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Bowrna">@Bowrna</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/22358" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/22358/hovercard">ScheduleInterval schema in OpenAPI specs should have "nullable: true" otherwise generated OpenAPI client will throw an error in case of nullable "schedule_interval" (#22358)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24260" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24260/hovercard">Use <code class="notranslate">get_hostname</code> instead of <code class="notranslate">socket.getfqdn</code> (#24260)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24262" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24262/hovercard">Optimize calendar view for cron scheduled DAGs (#24262)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/23602" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/23602/hovercard">Calendar view is taking too long to load in airflow 2.3.0 (#23602)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24284" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24284/hovercard">Speed up grid_data endpoint by 10x (#24284)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24320" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24320/hovercard">Fix bugs in URI constructor for MySQL connection (#24320)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MaksYermak/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MaksYermak">@MaksYermak</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24327" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24327/hovercard">Check for run_id for grid task groups (#24327)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/23947" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23947/hovercard">Fix and speed up grid view (#23947)</a></li>
<li><a href="https://github.com/apache/airflow/pull/23813" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/23813/hovercard">Grid data: do not load all mapped instances (#23813)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24335" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24335/hovercard"><code class="notranslate">TI.log_url</code> fix for <code class="notranslate">map_index</code> (#24335)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fritz-astronomer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fritz-astronomer">@fritz-astronomer</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/24328" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/24328/hovercard"><code class="notranslate">TI.log_url</code> is incorrect with mapped tasks (#24328)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24337" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24337/hovercard">Add typescript (#24337)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24357" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24357/hovercard">DebugExecutor use ti.run() instead of ti._run_raw_task (#24357)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sarvothaman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sarvothaman">@sarvothaman</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/o-nikolas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/o-nikolas">@o-nikolas</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/13322" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/13322/hovercard">Backfill crashes with "KeyError: TaskInstanceKey" when task has retries (#13322)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24362" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24362/hovercard">Mask secrets in stdout for CLI command (#24362)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alex-astronomer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alex-astronomer">@alex-astronomer</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/marclamberti/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/marclamberti">@marclamberti</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/21281" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/21281/hovercard">Mask secrets in stdout for <code class="notranslate">airflow tasks test ...</code> CLI command (#17476) (#21281)</a></li>
<li><a href="https://github.com/apache/airflow/issues/17476" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/17476/hovercard">Sensitive variables don't get masked when rendered with airflow tasks test (#17476)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24375" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24375/hovercard">Add tests for the grid_data endpoint (#24375)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24386" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24386/hovercard">Fix links to sources for examples (#24386)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24399" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24399/hovercard">Upgrade FAB to 4.1.1 (#24399)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24405" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24405/hovercard">Fix flaky order of returned dag runs (#24405)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24417" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24417/hovercard">Improve grid rendering performance with a custom tooltip (#24417)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24430" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24430/hovercard">Upgrade to react 18 and chakra 2 (#24430)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24449" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24449/hovercard">Remove framer-motion from custom tooltip (#24449)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24470" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24470/hovercard">Add missing types to FSHook (#24470)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lmarvaud/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lmarvaud">@lmarvaud</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24478" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24478/hovercard">Return empty dict if Pod JSON encoding fails (#24478)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24485" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24485/hovercard">Upgrade to webpack 5 (#24485)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24488" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24488/hovercard">Add indexes for CASCADE deletes for task_instance (#24488)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wolfier/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wolfier">@wolfier</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/24484" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/24484/hovercard"><code class="notranslate">airflow db clean task_instance</code> takes a long time (#24484)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24495" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24495/hovercard">Remove internet explorer support (#24495)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24499" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24499/hovercard">Add cache_ok flag to sqlalchemy TypeDecorators. (#24499)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jkinkead/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jkinkead">@jkinkead</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/NK74/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/NK74">@NK74</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/22647" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/22647/hovercard">SAWarning: TypeDecorator UtcDateTime(timezone=True) will not produce a cache key because the <code class="notranslate">cache_ok</code> attribute is not set to True (#22647)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24505" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24505/hovercard">Fix toast messages (#24505)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24506" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24506/hovercard">Fix deprecated log_id_template value (#24506)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24509" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24509/hovercard">Migrate jsx files that affect run/task selection to tsx (#24509)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24511" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24511/hovercard">Seed log_template table (#24511)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24516" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24516/hovercard">Update flask-appbuilder authlib/oauth dependency (#24516)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24519" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24519/hovercard">Get rid of TimedJSONWebSignatureSerializer (#24519)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/22397" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/22397/hovercard">Upgrade to FlaskAppBuilder 4.0.* (#22397)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24528" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24528/hovercard">Do not calculate grid root instances (#24528)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24569" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24569/hovercard">Patch sql_alchemy_conn if old Postgres schemes used (#24569)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/slyapustin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/slyapustin">@slyapustin</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/22333" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/22333/hovercard">Patch sql_alchemy_conn if old postgres scheme used (#22333)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24585" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24585/hovercard">Fix migration 0080_2_0_2 - Replace null values before setting column not null (#24585)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tm-drtina/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tm-drtina">@tm-drtina</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/20962" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/20962/hovercard">Support generating SQL script for upgrades (#20962)</a></li>
<li><a href="https://github.com/apache/airflow/issues/24566" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/24566/hovercard">Migration changes column to NOT NULL without updating NULL data first (#24566)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24592" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24592/hovercard">Move fallible ti.task.dag assignment back inside try/except block (#24533) (#24592)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ejk43/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ejk43">@ejk43</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/24533" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/24533/hovercard">es_task_handler.py crashes accessing "View Logs in Elasticsearch" (#24533)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24619" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24619/hovercard">Upgrade FAB to 4.1.2 (#24619)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24621" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24621/hovercard">We now need at least Flask-WTF 0.15 (#24621)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/24399" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24399/hovercard">Upgrade FAB to 4.1.1 (#24399)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24637" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24637/hovercard">Don't render child rows for closed groups (#24637)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24638" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24638/hovercard">Fix timestamp defaults for sensorinstance (#24638)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24684" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24684/hovercard">Fix Grid vertical scrolling (#24684)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24710" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24710/hovercard">Debounce status highlighting in Grid view (#24710)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24722" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24722/hovercard">Address all yarn test warnings (#24722)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24738" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24738/hovercard">Fix grid date ticks (#24738)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/pull/24684" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24684/hovercard">Fix Grid vertical scrolling (#24684)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/apache/airflow/pull/24819" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24819/hovercard">Remove upper-binding for SQLAlchemy (#24819)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24847" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24847/hovercard">Fix cycle bug with attaching label to task group (#24847)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rustikk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rustikk">@rustikk</a><br>
Linked issues:
<ul dir="auto">
<li><a href="https://github.com/apache/airflow/issues/19785" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/19785/hovercard">Applying labels to task groups shows a cycle in the graph view for the dag (#19785)</a></li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24849" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24849/hovercard">improve grid date tick spacing (#24849)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/apache/airflow/pull/24865" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/24865/hovercard">Fix exception in mini task scheduler. (#24865)</a>: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a></li>
</ul>
<p dir="auto">Thanks to all who contributed to the release (probably not a complete list!):<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Bowrna/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Bowrna">@Bowrna</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/GApfel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/GApfel">@GApfel</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/uranusjr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uranusjr">@uranusjr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexbegg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alexbegg">@alexbegg</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sdebruyn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sdebruyn">@sdebruyn</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/NK74/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/NK74">@NK74</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/argibbs/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/argibbs">@argibbs</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/slyapustin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/slyapustin">@slyapustin</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tanelk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tanelk">@tanelk</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rustikk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rustikk">@rustikk</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/omarsmak/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/omarsmak">@omarsmak</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hubert-pietron/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hubert-pietron">@hubert-pietron</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ashb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ashb">@ashb</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/marclamberti/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/marclamberti">@marclamberti</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eladkal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eladkal">@eladkal</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wolfier/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wolfier">@wolfier</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jhtimmins/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jhtimmins">@jhtimmins</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/torbjornvatn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/torbjornvatn">@torbjornvatn</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bernardocouto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bernardocouto">@bernardocouto</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gbonazzoli/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gbonazzoli">@gbonazzoli</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/erdos2n/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/erdos2n">@erdos2n</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sarvothaman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sarvothaman">@sarvothaman</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbovenzi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbovenzi">@bbovenzi</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dstandish/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dstandish">@dstandish</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jedcunningham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jedcunningham">@jedcunningham</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/o-nikolas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/o-nikolas">@o-nikolas</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MaksYermak/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MaksYermak">@MaksYermak</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/humit0/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/humit0">@humit0</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tm-drtina/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tm-drtina">@tm-drtina</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Taragolis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Taragolis">@Taragolis</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ejk43/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ejk43">@ejk43</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ephraimbuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ephraimbuddy">@ephraimbuddy</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/patryk126p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/patryk126p">@patryk126p</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/malthe/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/malthe">@malthe</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/viktorvia/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/viktorvia">@viktorvia</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fritz-astronomer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fritz-astronomer">@fritz-astronomer</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jkinkead/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jkinkead">@jkinkead</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alex-astronomer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alex-astronomer">@alex-astronomer</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pierrejeambrun/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pierrejeambrun">@pierrejeambrun</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pingzh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pingzh">@pingzh</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lmarvaud/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lmarvaud">@lmarvaud</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zachliu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zachliu">@zachliu</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bauerfranz/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bauerfranz">@bauerfranz</a></p>
<h3 dir="auto">Committer</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I acknowledge that I am a maintainer/committer of the Apache Airflow project.</li>
</ul> | <p dir="auto"><strong>Apache Airflow version</strong>: 2.0.0a2</p>
<p dir="auto">As of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="640821818" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/9363" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/9363/hovercard" href="https://github.com/apache/airflow/pull/9363">#9363</a>, the <code class="notranslate">tasks run</code> command attempts to restore the root logger handlers to the previous state after running the task with the handlers all replaced by those from the <code class="notranslate">airflow.tasks</code> logger.</p>
<p dir="auto">However, because no actual <em>copy</em> is created of the root handlers list, what you effectively end up with is either an empty list of handlers and nothing is restored. To make matters worse, the block ends with a <code class="notranslate">logging.shutdown()</code> call, which completely closes and releases all handlers.</p>
<p dir="auto">So, either the code to 'restore' can just be removed, or a proper copy needs to be made and the <code class="notranslate">logging.shutdown()</code> call needs to be removed from the command. <code class="notranslate">logging.shutdown</code> is going to be called when the interpreter exits, anyway.</p>
<p dir="auto">In detail, this is the code section:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/apache/airflow/blob/bec9f3b29fd42ecd1beae3db75784b9a726caf15/airflow/cli/commands/task_command.py#L194-L222">airflow/airflow/cli/commands/task_command.py</a>
</p>
<p class="mb-0 color-fg-muted">
Lines 194 to 222
in
<a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/bec9f3b29fd42ecd1beae3db75784b9a726caf15">bec9f3b</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L194" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="194"></td>
<td id="LC194" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># Get all the Handlers from 'airflow.task' logger</span> </td>
</tr>
<tr class="border-0">
<td id="L195" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="195"></td>
<td id="LC195" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># Add these handlers to the root logger so that we can get logs from</span> </td>
</tr>
<tr class="border-0">
<td id="L196" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="196"></td>
<td id="LC196" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># any custom loggers defined in the DAG</span> </td>
</tr>
<tr class="border-0">
<td id="L197" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="197"></td>
<td id="LC197" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">airflow_logger_handlers</span> <span class="pl-c1">=</span> <span class="pl-s1">logging</span>.<span class="pl-en">getLogger</span>(<span class="pl-s">'airflow.task'</span>).<span class="pl-s1">handlers</span> </td>
</tr>
<tr class="border-0">
<td id="L198" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="198"></td>
<td id="LC198" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span> <span class="pl-c1">=</span> <span class="pl-s1">logging</span>.<span class="pl-en">getLogger</span>() </td>
</tr>
<tr class="border-0">
<td id="L199" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="199"></td>
<td id="LC199" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger_handlers</span> <span class="pl-c1">=</span> <span class="pl-s1">root_logger</span>.<span class="pl-s1">handlers</span> </td>
</tr>
<tr class="border-0">
<td id="L200" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="200"></td>
<td id="LC200" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td>
</tr>
<tr class="border-0">
<td id="L201" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="201"></td>
<td id="LC201" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># Remove all handlers from Root Logger to avoid duplicate logs</span> </td>
</tr>
<tr class="border-0">
<td id="L202" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="202"></td>
<td id="LC202" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">handler</span> <span class="pl-c1">in</span> <span class="pl-s1">root_logger_handlers</span>: </td>
</tr>
<tr class="border-0">
<td id="L203" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="203"></td>
<td id="LC203" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span>.<span class="pl-en">removeHandler</span>(<span class="pl-s1">handler</span>) </td>
</tr>
<tr class="border-0">
<td id="L204" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="204"></td>
<td id="LC204" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td>
</tr>
<tr class="border-0">
<td id="L205" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="205"></td>
<td id="LC205" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">handler</span> <span class="pl-c1">in</span> <span class="pl-s1">airflow_logger_handlers</span>: </td>
</tr>
<tr class="border-0">
<td id="L206" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="206"></td>
<td id="LC206" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span>.<span class="pl-en">addHandler</span>(<span class="pl-s1">handler</span>) </td>
</tr>
<tr class="border-0">
<td id="L207" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="207"></td>
<td id="LC207" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span>.<span class="pl-en">setLevel</span>(<span class="pl-s1">logging</span>.<span class="pl-en">getLogger</span>(<span class="pl-s">'airflow.task'</span>).<span class="pl-s1">level</span>) </td>
</tr>
<tr class="border-0">
<td id="L208" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="208"></td>
<td id="LC208" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td>
</tr>
<tr class="border-0">
<td id="L209" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="209"></td>
<td id="LC209" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">with</span> <span class="pl-en">redirect_stdout</span>(<span class="pl-v">StreamLogWriter</span>(<span class="pl-s1">ti</span>.<span class="pl-s1">log</span>, <span class="pl-s1">logging</span>.<span class="pl-v">INFO</span>)), <span class="pl-en">redirect_stderr</span>( </td>
</tr>
<tr class="border-0">
<td id="L210" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="210"></td>
<td id="LC210" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-v">StreamLogWriter</span>(<span class="pl-s1">ti</span>.<span class="pl-s1">log</span>, <span class="pl-s1">logging</span>.<span class="pl-v">WARN</span>) </td>
</tr>
<tr class="border-0">
<td id="L211" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="211"></td>
<td id="LC211" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> ): </td>
</tr>
<tr class="border-0">
<td id="L212" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="212"></td>
<td id="LC212" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">_run_task_by_selected_method</span>(<span class="pl-s1">args</span>, <span class="pl-s1">dag</span>, <span class="pl-s1">ti</span>) </td>
</tr>
<tr class="border-0">
<td id="L213" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="213"></td>
<td id="LC213" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td>
</tr>
<tr class="border-0">
<td id="L214" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="214"></td>
<td id="LC214" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># We need to restore the handlers to the loggers as celery worker process</span> </td>
</tr>
<tr class="border-0">
<td id="L215" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="215"></td>
<td id="LC215" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># can call this command multiple times,</span> </td>
</tr>
<tr class="border-0">
<td id="L216" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="216"></td>
<td id="LC216" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># so if we don't reset this then logs from next task would go to the wrong place</span> </td>
</tr>
<tr class="border-0">
<td id="L217" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="217"></td>
<td id="LC217" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">handler</span> <span class="pl-c1">in</span> <span class="pl-s1">airflow_logger_handlers</span>: </td>
</tr>
<tr class="border-0">
<td id="L218" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="218"></td>
<td id="LC218" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span>.<span class="pl-en">removeHandler</span>(<span class="pl-s1">handler</span>) </td>
</tr>
<tr class="border-0">
<td id="L219" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="219"></td>
<td id="LC219" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">handler</span> <span class="pl-c1">in</span> <span class="pl-s1">root_logger_handlers</span>: </td>
</tr>
<tr class="border-0">
<td id="L220" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="220"></td>
<td id="LC220" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">root_logger</span>.<span class="pl-en">addHandler</span>(<span class="pl-s1">handler</span>) </td>
</tr>
<tr class="border-0">
<td id="L221" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="221"></td>
<td id="LC221" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> </td>
</tr>
<tr class="border-0">
<td id="L222" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="222"></td>
<td id="LC222" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">logging</span>.<span class="pl-en">shutdown</span>() </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">The first problem here is that <code class="notranslate">root_logger_handlers = root_logger.handlers</code> merely creates a reference to the logger <code class="notranslate">handlers</code> list. The <code class="notranslate">root_logger.removeHandler(handler)</code> in a loop further on remove the handlers from that same list as you iterate, and this causes it to <a href="https://sopython.com/canon/95/removing-items-from-a-list-while-iterating-over-the-list/" rel="nofollow">only remove <em>every second handler</em></a>. Luckily, this was never a problem because in the standard configuration there is only a single handler on the root. If there are more, there is a bigger problem further down.</p>
<p dir="auto">Continuing on, the next loop, adding handlers from <code class="notranslate">airflow_logger_handlers</code>, causes those same handlers to show up in the <code class="notranslate">root_logger_handlers</code> reference, but those very same handlers are removed again in a second loop over the same <code class="notranslate">airflow_logger_handlers</code> list.</p>
<p dir="auto">So when you hit the final <code class="notranslate">for handler in root_logger_handlers: root_logger.addHandler(handler)</code> loop, either <code class="notranslate">root_logger_handlers</code> is an empty list (no handlers added), or, if you started with more than one root handler and every second handler was left in place, you now are adding handlers to the list that are already in the list. The <code class="notranslate">Logger.addHandler()</code> method uses <code class="notranslate">self.handler.append()</code>, appending to a list you are iterating over, and so you have an infinite loop on your hands.</p>
<p dir="auto">Either just remove all handlers from the root logger (taking care to loop over the list in reverse, e.g. <code class="notranslate">for h in reversed(root_logger.handlers): root_logger.removeHandler(h)</code>), or create proper copy of the list with <code class="notranslate">root_logger_handlers = root_logger.handlers[:]</code>. The <code class="notranslate">logging.shutdown()</code> call has to be removed then too.</p> | 0 |
<p dir="auto">Noticing a security vulnerability [<a title="CVE-2021-3807" data-hovercard-type="advisory" data-hovercard-url="/advisories/GHSA-93q8-gq69-wqmw/hovercard" href="https://github.com/advisories/GHSA-93q8-gq69-wqmw">CVE-2021-3807</a>] when scanning the "npm" package with JFrog Xray as below:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/703559/151667874-2cd4456e-29f1-4514-868a-972e5cb96e77.png"><img src="https://user-images.githubusercontent.com/703559/151667874-2cd4456e-29f1-4514-868a-972e5cb96e77.png" width="500" style="max-width: 100%;"></a></p>
<p dir="auto">The package cli-table3 and one of its dependency ansi-regex need to be bumped up in order to fix this issue.</p>
<p dir="auto"><strong>Full Dependency Tree:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected] "><pre class="notranslate"><code class="notranslate">[email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
</code></pre></div>
<p dir="auto">This vulnerability is reported with a "High Severity".</p>
<p dir="auto">The vulnerability is fixed with [email protected]</p>
<p dir="auto">Please advise.</p>
<p dir="auto">Thanks in advance.</p>
<p dir="auto">(Also see: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1067404012" data-permission-text="Title is private" data-url="https://github.com/nodejs/node/issues/41039" data-hovercard-type="issue" data-hovercard-url="/nodejs/node/issues/41039/hovercard" href="https://github.com/nodejs/node/issues/41039">nodejs/node#41039</a>)</p> | <p dir="auto">Our team found an issue of npm inconsistent install while migrating from lerna to npm@7 workspaces. It looks like inability to install proper dependencies if there is previous state of node_modules when checking out between branches. The result differs if previous node_modules is present or not.</p>
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">The dependencies have incorrect versions after install.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">The dependencies have correct version even after checkout between branches.</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<p dir="auto">Here's git bundle (I've put it to archive because of github limitations).<br>
<a href="https://github.com/npm/cli/files/6142903/npm-7-migration-bug.bundle.zip">npm-7-migration-bug.bundle.zip</a><br>
There're two commits in branch <code class="notranslate">narrow1</code>. They display broken transition we experience. To test if dependencies are broken or not I check version of axios. It should be 0.20 on first commit and 0.21.1 on second. It version is 0.20.0 on second commit, then we have a bug.</p>
<ul dir="auto">
<li>git checkout narrow1</li>
<li>git checkout HEAD~</li>
<li>npm start # here we create initial state for node_modules</li>
<li>head ./node_modules/axios/package.json # version = 0.20.0, correct</li>
<li>git checkout -</li>
<li>npm start # here we trying to actualize state of node_modules</li>
<li>head ./node_modules/axios/package.json # version = 0.20.0, incorrect, must be = 0.21.1</li>
<li>rm -rf ./node_modules</li>
<li>npm start # running from scratch yields correct state, version = 0.21.1</li>
</ul>
<h3 dir="auto">Environment:</h3>
<p dir="auto">OS is GNU/Linux, but we have devs with the same issue on Windows machines.<br>
In repro I'm using node@12 and npm@7 for broken commit.</p> | 0 |
<p dir="auto">It seems that I'm unable to make elasticsearch query for boolean true values. Boolean false works fine.</p>
<p dir="auto">Elasticsearch version: 0.20.1</p>
<p dir="auto">Steps to reproduce (in shell script form):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="curl -XDELETE http://localhost:9200/rctest
echo
curl -XPOST http://localhost:9200/rctest/attendants/123 -d '{"is_cool":true}'
echo
curl -XPOST http://localhost:9200/rctest/attendants/321 -d '{"is_cool":false}'
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query A"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":true}}}'
echo
echo "*** Result of Query A as query params"
curl -XGET "http://localhost:9200/rctest/_search?q=is_cool:true"
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query B"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":false}}}'
echo
echo "*** Result of Query B as query params"
curl -XGET "http://localhost:9200/rctest/_search?q=is_cool:false"
echo"><pre class="notranslate"><code class="notranslate">curl -XDELETE http://localhost:9200/rctest
echo
curl -XPOST http://localhost:9200/rctest/attendants/123 -d '{"is_cool":true}'
echo
curl -XPOST http://localhost:9200/rctest/attendants/321 -d '{"is_cool":false}'
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query A"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":true}}}'
echo
echo "*** Result of Query A as query params"
curl -XGET "http://localhost:9200/rctest/_search?q=is_cool:true"
echo
echo "*** REFRESH"
curl -XPOST http://localhost:9200/rctest/_refresh
echo
echo "*** All documents"
curl -XGET http://localhost:9200/rctest/attendants/_search
echo
echo "*** Result of query B"
curl -XGET http://localhost:9200/rctest/attendants/_search -d '{"query":{"term":{"is_cool":false}}}'
echo
echo "*** Result of Query B as query params"
curl -XGET "http://localhost:9200/rctest/_search?q=is_cool:false"
echo
</code></pre></div>
<p dir="auto">Output of that shell script:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{"ok":true,"acknowledged":true}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"123","_version":1}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"321","_version":1}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query A
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*** Result of Query A as query params
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query B
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":0.30685282, "_source" : {"is_cool":false}}]}}
*** Result of Query B as query params
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":0.30685282, "_source" : {"is_cool":false}}]}}"><pre class="notranslate"><code class="notranslate">{"ok":true,"acknowledged":true}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"123","_version":1}
{"ok":true,"_index":"rctest","_type":"attendants","_id":"321","_version":1}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query A
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*** Result of Query A as query params
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
*** REFRESH
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
*** All documents
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":2,"max_score":1.0,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":1.0, "_source" : {"is_cool":false}},{"_index":"rctest","_type":"attendants","_id":"123","_score":1.0, "_source" : {"is_cool":true}}]}}
*** Result of query B
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":0.30685282, "_source" : {"is_cool":false}}]}}
*** Result of Query B as query params
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.30685282,"hits":[{"_index":"rctest","_type":"attendants","_id":"321","_score":0.30685282, "_source" : {"is_cool":false}}]}}
</code></pre></div>
<p dir="auto">As you can see, the query for {is_cool: true} doesn't return any data.</p> | <p dir="auto">Effectively, indexing it as lowercase <code class="notranslate">t</code> instead of upper case <code class="notranslate">T</code>. See repo here: <a href="https://gist.github.com/adba5adb18555033f1c1">https://gist.github.com/adba5adb18555033f1c1</a>.</p> | 1 |
<p dir="auto">Uncaught Error: EACCES, open '/home/rhocassiopeiae/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'</p>
<p dir="auto"><strong>Atom Version</strong>: 0.158.0<br>
<strong>System</strong>: linux 3.13.0-43-generic<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>...</li>
<li>...</li>
</ol>
<h3 dir="auto">Stack Trace</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At fs.js:75
Error: EACCES, open '/home/rhocassiopeiae/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'
at Error (native)
"><pre class="notranslate"><code class="notranslate">At fs.js:75
Error: EACCES, open '/home/rhocassiopeiae/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'
at Error (native)
</code></pre></div> | <p dir="auto">Steps for reproduce:</p>
<blockquote>
<p dir="auto">Open atom<br>
Open folder with source code<br>
Select any source file from trreview<br>
rigth click and duplicate file<br>
crash</p>
</blockquote>
<p dir="auto">I am using Fedora 21 and atom version is 0.168.0</p>
<p dir="auto">Here the output:</p>
<p dir="auto">[fabio@ironhide ~]$ /usr/bin/atom: line 92: 10917 Segmentation fault (core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$DOT_ATOM_DIR/nohup.out" 2>&1<br>
[10917:0108/113744:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See <a href="https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment" rel="nofollow">https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment</a> for more information on developing with the sandbox on.<br>
libGL error: MESA-LOADER: could not create udev device for fd 12<br>
libGL error: MESA-LOADER: could not create udev device for fd 12<br>
ATTENTION: default value of option force_s3tc_enable overridden by environment.<br>
App load time: 278ms<br>
[10970:0108/113745:INFO:renderer_main.cc(207)] Renderer process started<br>
[10917:0108/113746:INFO:CONSOLE(92)] "Download the React DevTools for a better development experience: <a href="http://fb.me/react-devtools" rel="nofollow">http://fb.me/react-devtools</a>", source: /usr/share/atom/resources/app/node_modules/react-atom-fork/lib/React.js (92)<br>
[10917:0108/113747:INFO:CONSOLE(64)] "Window load time: 1968ms", source: file:///usr/share/atom/resources/app/static/index.js (64)<br>
Crash dump id: 9cee5385-744a-4d2f-b907-388b21ff66d5</p> | 0 |
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import seaborn as sns;sns.set()
import matplotlib.pyplot as plt
penguins = sns.load_dataset("penguins")
# sns.displot(data=penguins, x="flipper_length_mm",label='policy_0',kind="hist")
sns.histplot(data=penguins, x="flipper_length_mm",label='policy_1')
plt.legend()
plt.savefig("test.png")"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">seaborn</span> <span class="pl-k">as</span> <span class="pl-s1">sns</span>;<span class="pl-s1">sns</span>.<span class="pl-en">set</span>()
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-s1">penguins</span> <span class="pl-c1">=</span> <span class="pl-s1">sns</span>.<span class="pl-en">load_dataset</span>(<span class="pl-s">"penguins"</span>)
<span class="pl-c"># sns.displot(data=penguins, x="flipper_length_mm",label='policy_0',kind="hist")</span>
<span class="pl-s1">sns</span>.<span class="pl-en">histplot</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">penguins</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">"flipper_length_mm"</span>,<span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'policy_1'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">legend</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">"test.png"</span>)</pre></div>
<p dir="auto">By running belowing codes, I got a figure like:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/39483938/200516845-de61003e-becf-4459-8872-90a675ffb631.png"><img width="636" alt="image" src="https://user-images.githubusercontent.com/39483938/200516845-de61003e-becf-4459-8872-90a675ffb631.png" style="max-width: 100%;"></a></p>
<p dir="auto">It seems to repeat the legends, could you fixed it soon? It will be pretty nice of you!</p> | <p dir="auto">Consider data points that describe:</p>
<ul dir="auto">
<li>different animal species</li>
<li>each specie lives across different countries</li>
<li>a population for each specie in each country</li>
</ul>
<p dir="auto">The current plotting histograms considers each bin (animal specie) as a full collection of data and each hue (country) as separate <em>histograms</em>.<br>
Since each specie is decoupled one would like to do something like this:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sns.histplot(population, x='specie', hue='country', stat='probability')"><pre class="notranslate"><span class="pl-s1">sns</span>.<span class="pl-en">histplot</span>(<span class="pl-s1">population</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">'specie'</span>, <span class="pl-s1">hue</span><span class="pl-c1">=</span><span class="pl-s">'country'</span>, <span class="pl-s1">stat</span><span class="pl-c1">=</span><span class="pl-s">'probability'</span>)</pre></div>
<p dir="auto">however this will not decouple the species from each other. What would be nice if one could normalize each specie individually across the countries, aka:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sns.histplot(population, x='specie', hue='country', stat='probability', bin_norm=True, common_norm=True)"><pre class="notranslate"><span class="pl-s1">sns</span>.<span class="pl-en">histplot</span>(<span class="pl-s1">population</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">'specie'</span>, <span class="pl-s1">hue</span><span class="pl-c1">=</span><span class="pl-s">'country'</span>, <span class="pl-s1">stat</span><span class="pl-c1">=</span><span class="pl-s">'probability'</span>, <span class="pl-s1">bin_norm</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">common_norm</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</pre></div>
<p dir="auto">which normalizes across hues for each bin plot. This would make all bin sizes equal height of 1, but the hue for each will show the probability distribution for the specie population and clearly indicate which specie has a tendency in each country.</p>
<p dir="auto">I agree this isn't the regular histogram, but perhaps it would fit seaborn anyways? :)</p> | 0 |
<p dir="auto">Fallout of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="54437366" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21191" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/21191/hovercard" href="https://github.com/rust-lang/rust/pull/21191">#21191</a>. <code class="notranslate">-C opt-level=2</code> sets <code class="notranslate">CodegenOptions::opt_level</code> but <code class="notranslate">-O</code> doesn't, and <code class="notranslate">-C lto</code> path only looks at that. Due to the fallback from LTO path, <code class="notranslate">-O -C lto</code> is currently same to <code class="notranslate">-C opt-level=0 -C lto</code> (!).</p> | <p dir="auto"><code class="notranslate">-O</code> seems to function like an alias for <code class="notranslate">-C opt-level=2</code>, but <code class="notranslate">-O</code> does not enable certain LTO LLVM optimizations (inlining?), whereas <code class="notranslate">-C opt-level=2</code> does. This seems like a mistake.</p>
<p dir="auto">The problem is this code in <code class="notranslate">librustc_trans/back/lto.rs</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" let opt = sess.opts.cg.opt_level.unwrap_or(0) as libc::c_uint;
let builder = llvm::LLVMPassManagerBuilderCreate();
llvm::LLVMPassManagerBuilderSetOptLevel(builder, opt);
llvm::LLVMPassManagerBuilderPopulateLTOPassManager(builder, pm,
/* Internalize = */ False,
/* RunInliner = */ True);
llvm::LLVMPassManagerBuilderDispose(builder);"><pre class="notranslate"><code class="notranslate"> let opt = sess.opts.cg.opt_level.unwrap_or(0) as libc::c_uint;
let builder = llvm::LLVMPassManagerBuilderCreate();
llvm::LLVMPassManagerBuilderSetOptLevel(builder, opt);
llvm::LLVMPassManagerBuilderPopulateLTOPassManager(builder, pm,
/* Internalize = */ False,
/* RunInliner = */ True);
llvm::LLVMPassManagerBuilderDispose(builder);
</code></pre></div>
<p dir="auto"><code class="notranslate">sess.opts.cg.opt_level</code> is the <code class="notranslate">-C opt-level</code> setting, which is <code class="notranslate">None</code> with <code class="notranslate">-O</code>.</p>
<p dir="auto">test.rs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pub fn test() {}"><pre class="notranslate"><code class="notranslate">pub fn test() {}
</code></pre></div>
<p dir="auto">output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc test.rs --crate-type staticlib --emit llvm-ir -C lto -O
$ ls -l test.ll
-rw-rw-r-- 1 rprichard rprichard 36920440 Feb 19 00:25 test.ll
$ rustc test.rs --crate-type staticlib --emit llvm-ir -C lto -C opt-level=2
$ ls -l test.ll
-rw-rw-r-- 1 rprichard rprichard 1312070 Feb 19 00:25 test.ll"><pre class="notranslate"><code class="notranslate">$ rustc test.rs --crate-type staticlib --emit llvm-ir -C lto -O
$ ls -l test.ll
-rw-rw-r-- 1 rprichard rprichard 36920440 Feb 19 00:25 test.ll
$ rustc test.rs --crate-type staticlib --emit llvm-ir -C lto -C opt-level=2
$ ls -l test.ll
-rw-rw-r-- 1 rprichard rprichard 1312070 Feb 19 00:25 test.ll
</code></pre></div>
<p dir="auto">I think we should base the LLVM optimization level on <code class="notranslate">sess.opts.optimize</code>. (Maybe it ought to use <code class="notranslate">write::get_llvm_opt_level</code>?)</p> | 1 |
<p dir="auto">How to use threads in angular2 -Thread method like sleep(),wait()</p> | <p dir="auto">Hello,</p>
<p dir="auto">how can we do synchronized method calling in angular2 -Threads(sleep(),wait() ).</p> | 1 |
<p dir="auto">The control height classes listed on <a href="http://getbootstrap.com/css/#forms-control-sizes" rel="nofollow">http://getbootstrap.com/css/#forms-control-sizes</a> do not match the classes that actually exists in bootstrap.css and bootstrap.min.css.</p>
<p dir="auto"><code class="notranslate">.input-lg</code> is shown in the documentation,but <code class="notranslate">.input-large</code> is configured in the css. Likewise, <code class="notranslate">.input-sm</code> is shown in the documentation, but <code class="notranslate">.input-small</code> is configured.</p> | <p dir="auto">To increase/decrease the size of form controls, you can add the classes input-lg or input-sm (at least according to the website [http://getbootstrap.com/css/#forms] - which is the most consistent solution). In the css code, however, the classes are called input-large and input-small.</p> | 1 |
<p dir="auto">I was looking for a way to set a remember me cookie programmatically from inside a service. So I am not coming through a standard form login. Unfortunately all the remember me services are private and so I can not access them. Is there another way to solve this problem? I am using Symfony version 2.4.</p> | <p dir="auto">Just bringing attention to this particular issue since all the @ mentions are getting no response there. See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="6075543" data-permission-text="Title is private" data-url="https://github.com/FriendsOfSymfony/FOSUserBundle/issues/747" data-hovercard-type="issue" data-hovercard-url="/FriendsOfSymfony/FOSUserBundle/issues/747/hovercard" href="https://github.com/FriendsOfSymfony/FOSUserBundle/issues/747">FriendsOfSymfony/FOSUserBundle#747</a>. If there is a better way to bring stuff like this to attention, then it would be good to know.</p>
<p dir="auto">Quoting <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stof/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stof">@stof</a>:</p>
<blockquote>
<p dir="auto">The remember me services are private so they are removed from the container when optimizing it. This means that the has checks in the LoginManager will return false even when the remember me is activated for the firewall.</p>
</blockquote> | 1 |
<ul dir="auto">
<li>VSCode Version: 1.2.0</li>
<li>OS Version: Win10</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Create a new file e.g. test.php</li>
<li>Copy this:</li>
</ol>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
</head>
<body>
<?php $someVar = 'hello'; ?>
<?php $someVar = 'hello';
?>
</body>
</html>"><pre class="notranslate"><span class="pl-c1"><!DOCTYPE html<span class="pl-kos">></span></span>
<span class="pl-kos"><</span><span class="pl-ent">html</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">head</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">meta</span> <span class="pl-c1">http-equiv</span>="<span class="pl-s">Content-Type</span>" <span class="pl-c1">content</span>="<span class="pl-s">text/html; charset=utf-8</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">title</span><span class="pl-kos">></span>Test<span class="pl-kos"></</span><span class="pl-ent">title</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">head</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">body</span><span class="pl-kos">></span>
<span class="pl-kos"><</span>?php $someVar = 'hello'; ?<span class="pl-kos">></span>
<span class="pl-kos"><</span>?php $someVar = 'hello';
?<span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">body</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">html</span><span class="pl-kos">></span></pre></div>
<ol dir="auto">
<li>Set the language mode to PHP</li>
<li>Select Theme: Dark+ (default dark)</li>
<li>You will notice now, that there is some miss matching between a one line of code or when you expand it.</li>
</ol>
<p dir="auto">I'm not sure if this just a problem with the theme, how ever the problem appeared when I installed to update to version 1.2 today.</p> | <ul dir="auto">
<li>VSCode Version: 1.2.1</li>
<li>OS Version: Windows 7</li>
</ul>
<p dir="auto">Commands within one single line do not appear to have the correct highlight.</p>
<p dir="auto">Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<?php foreach (array() as $array) { ?>
<?php } ?>"><pre class="notranslate"><code class="notranslate"><?php foreach (array() as $array) { ?>
<?php } ?>
</code></pre></div> | 1 |
<p dir="auto">Druid indexing needs to be revisited to improve indexing performance and functional capability. Currently, v8 segments are created by IndexMerger and converted to v9. We should be able to build v9 segments directly.</p> | <p dir="auto">The indexing code is getting old and the method of updating the storage format is essentially amounting to writing in an old version and converting up multiple times. This is less than optimal and not a good sign for future maintenance.</p>
<p dir="auto">We need to look at the indexing code and fixor it up to make it betterz.</p> | 1 |
<p dir="auto">Step to reproduce:</p>
<ol dir="auto">
<li>Go to an old user profile, for example mine <a href="http://www.freecodecamp.com/aluzardo" rel="nofollow">http://www.freecodecamp.com/aluzardo</a></li>
</ol>
<p dir="auto">Expected: Show all the challenges with the correct category name.<br>
Actual: I can see some challenges with the old categories names “Bonfires, Waypoints…”</p> | <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6775919/12354088/68b75568-bb48-11e5-8ec5-c992c8333b7f.png"><img src="https://cloud.githubusercontent.com/assets/6775919/12354088/68b75568-bb48-11e5-8ec5-c992c8333b7f.png" alt="camper_berkeleytrue_s_code_portfolio___free_code_camp" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto">I had a deps file that looks like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export * as React from "https://dev.jspm.io/react";
export * as ReactDOM from "https://dev.jspm.io/react-dom";"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-s1">as</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">"https://dev.jspm.io/react"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-s1">as</span> <span class="pl-v">ReactDOM</span> <span class="pl-k">from</span> <span class="pl-s">"https://dev.jspm.io/react-dom"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">and then the file consuming it...</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { React, ReactDOM } from "./deps.js";
const rootEl = document.getElementById("root");
ReactDOM.render(<div>hello, world</div>, rootEl);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">React</span><span class="pl-kos">,</span> <span class="pl-v">ReactDOM</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./deps.js"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">rootEl</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">"root"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-c1"><</span><span class="pl-ent">div</span><span class="pl-c1">></span>hello, world<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span><span class="pl-kos">,</span> <span class="pl-s1">rootEl</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I then ran <code class="notranslate">deno bundle mod.js app.bundle.js</code>. The outputted bundle was missing the react and react-dom dependencies entirely. Changing my deps file to the below fixed the issue:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export { default as React } from "https://dev.jspm.io/react";
export { default as ReactDOM } from "https://dev.jspm.io/react-dom";"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-s1">default</span> <span class="pl-k">as</span> <span class="pl-v">React</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://dev.jspm.io/react"</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-s1">default</span> <span class="pl-k">as</span> <span class="pl-v">ReactDOM</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://dev.jspm.io/react-dom"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I realize they don't mean the exact same thing but for <code class="notranslate">React</code> and <code class="notranslate">ReactDOM</code>, it does. I'm not sure if I'm missing something here. Thanks!</p> | <p dir="auto">Hi,</p>
<p dir="auto">in my tsconfig.json:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""compilerOptions": {
"lib": ["esnext", "dom", "deno.ns"]
}"><pre class="notranslate"><span class="pl-ent">"compilerOptions"</span>: {
<span class="pl-ent">"lib"</span>: [<span class="pl-s"><span class="pl-pds">"</span>esnext<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>dom<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>deno.ns<span class="pl-pds">"</span></span>]
}</pre></div>
<p dir="auto">...and with Deno 0.35.0:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error TS2488: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator.
► https://deno.land/std/http/io.ts:135:24
135 for (const [k, v] of result) {
~~~~~~
error TS2488: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator.
► https://deno.land/std/http/io.ts:206:30
206 for (const [key, value] of trailers) {
~~~~~~~~
error TS2488: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator.
► https://deno.land/std/http/io.ts:260:30
260 for (const [key, value] of headers) {"><pre class="notranslate">error TS2488: Type <span class="pl-s"><span class="pl-pds">'</span>Headers<span class="pl-pds">'</span></span> must have a <span class="pl-s"><span class="pl-pds">'</span>[Symbol.iterator]()<span class="pl-pds">'</span></span> method that returns an iterator.
► https://deno.land/std/http/io.ts:135:24
135 <span class="pl-k">for</span> (const [k, v] of result) {
<span class="pl-k">~</span>~~~~~
error TS2488: Type <span class="pl-s"><span class="pl-pds">'</span>Headers<span class="pl-pds">'</span></span> must have a <span class="pl-s"><span class="pl-pds">'</span>[Symbol.iterator]()<span class="pl-pds">'</span></span> method that returns an iterator.
► https://deno.land/std/http/io.ts:206:30
206 <span class="pl-k">for</span> (const [key, value] of trailers) {
<span class="pl-k">~</span>~~~~~~~
error TS2488: Type <span class="pl-s"><span class="pl-pds">'</span>Headers<span class="pl-pds">'</span></span> must have a <span class="pl-s"><span class="pl-pds">'</span>[Symbol.iterator]()<span class="pl-pds">'</span></span> method that returns an iterator.
► https://deno.land/std/http/io.ts:260:30
260 <span class="pl-k">for</span> (const [key, value] of headers) {</pre></div> | 0 |
<p dir="auto">Just playing with higher-order functions and structs with function fields.</p>
<p dir="auto">I tried this code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// the main function
fn main() {
let funcs = Funcs {
a: Box::new( |x| { 1 + x } ),
b: Box::new( |x| { x * 2 } )
};
let composed = compose(&funcs.a, &funcs.b);
let r1: i32 = composed(3);
let r2: i32 = composed(10);
println!("r1 is {}", r1);
println!("r2 is {}", r2);
}
// a higher order function
fn compose<'a, T, F: 'a, G: 'a>(f: &'a F, g: &'a G) -> Box<Fn(T) -> T + 'a>
where
F: Fn(T) -> T,
G: Fn(T) -> T {
Box::new(move |x| { f(g(x)) })
}
struct Funcs {
a: Box<Fn(i32) -> i32>,
b: Box<Fn(i32) -> i32>,
}"><pre class="notranslate"><code class="notranslate">// the main function
fn main() {
let funcs = Funcs {
a: Box::new( |x| { 1 + x } ),
b: Box::new( |x| { x * 2 } )
};
let composed = compose(&funcs.a, &funcs.b);
let r1: i32 = composed(3);
let r2: i32 = composed(10);
println!("r1 is {}", r1);
println!("r2 is {}", r2);
}
// a higher order function
fn compose<'a, T, F: 'a, G: 'a>(f: &'a F, g: &'a G) -> Box<Fn(T) -> T + 'a>
where
F: Fn(T) -> T,
G: Fn(T) -> T {
Box::new(move |x| { f(g(x)) })
}
struct Funcs {
a: Box<Fn(i32) -> i32>,
b: Box<Fn(i32) -> i32>,
}
</code></pre></div>
<p dir="auto">I expected to see this happen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
Running `target/debug/rust_hello`
r1 is 7
r2 is 21"><pre class="notranslate"><code class="notranslate">Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
Running `target/debug/rust_hello`
r1 is 7
r2 is 21
</code></pre></div>
<p dir="auto">Instead, this happened:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10 let composed = compose(&funcs.a, &funcs.b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130"><pre class="notranslate"><code class="notranslate">Compiling rust_hello v0.0.1 (file:///home/mike/source/rust_hello)
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10 let composed = compose(&funcs.a, &funcs.b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
</code></pre></div>
<h2 dir="auto">Meta</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc --version --verbose
rustc 1.0.0-nightly (30e1f9a1c 2015-03-14) (built 2015-03-15)
binary: rustc
commit-hash: 30e1f9a1c2bf7134135800bc9afd082773defadc
commit-date: 2015-03-14
build-date: 2015-03-15
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly"><pre class="notranslate"><code class="notranslate">rustc --version --verbose
rustc 1.0.0-nightly (30e1f9a1c 2015-03-14) (built 2015-03-15)
binary: rustc
commit-hash: 30e1f9a1c2bf7134135800bc9afd082773defadc
commit-date: 2015-03-14
build-date: 2015-03-15
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
</code></pre></div>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="RUST_BACKTRACE=1 rustc src/main.rs
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10 let composed = compose(&funcs.a, &funcs.b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
stack backtrace:
1: 0x7fb896007fd4 - sys::backtrace::write::hc598c94e8fe3368fYyC
2: 0x7fb89602dd98 - panicking::on_panic::he6f0d5fd56790ce4OGI
3: 0x7fb895f64faa - rt::unwind::begin_unwind_inner::h0de67d11bf40bff3mnI
4: 0x7fb8933e140d - rt::unwind::begin_unwind::h1003680148821460282
5: 0x7fb8933e13b3 - diagnostic::SpanHandler::span_bug::h1c5c4bceba1974e2FaB
6: 0x7fb893c98523 - session::Session::span_bug::h04e509cfca0af677Qvn
7: 0x7fb894cc60e1 - check::regionck::visit_expr::h6d73f9ea96a73481dCd
8: 0x7fb894cc69fa - check::regionck::visit_local::h94f330bbd6249aa8izd
9: 0x7fb894cc18a5 - check::regionck::Rcx<'a, 'tcx>::visit_fn_body::h91c2ca9bef55fb39qed
10: 0x7fb894d4c566 - check::check_bare_fn::ha0fa7770160c8d54b8m
11: 0x7fb894d44681 - check::check_item::h289f0c28a59d81b7Pqn
12: 0x7fb894e18a03 - check_crate::closure.35785
13: 0x7fb894e1373a - check_crate::h77f9ea673c087f80O3B
14: 0x7fb89662fbf8 - driver::phase_3_run_analysis_passes::h716709d467e74aabqGa
15: 0x7fb896616f59 - driver::compile_input::h56dbe0e66fe8a956Rba
16: 0x7fb8966cea42 - run_compiler::hbbbe30f1ad654d0ex2b
17: 0x7fb8966cc88c - thunk::F.Invoke<A, R>::invoke::h9510793753674638958
18: 0x7fb8966cb910 - rt::unwind::try::try_fn::h15118916039308917284
19: 0x7fb89609ef58 - rust_try_inner
20: 0x7fb89609ef45 - rust_try
21: 0x7fb8966cbdb6 - thunk::F.Invoke<A, R>::invoke::h8595907971712275588
22: 0x7fb89601c995 - sys::thread::thread_start::h9f0c06661d546448B1G
23: 0x7fb88fec2181 - start_thread
24: 0x7fb895bd647c - __clone
25: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate">RUST_BACKTRACE=1 rustc src/main.rs
src/main.rs:10:20: 10:47 error: internal compiler error: cat_expr Errd
src/main.rs:10 let composed = compose(&funcs.a, &funcs.b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130
stack backtrace:
1: 0x7fb896007fd4 - sys::backtrace::write::hc598c94e8fe3368fYyC
2: 0x7fb89602dd98 - panicking::on_panic::he6f0d5fd56790ce4OGI
3: 0x7fb895f64faa - rt::unwind::begin_unwind_inner::h0de67d11bf40bff3mnI
4: 0x7fb8933e140d - rt::unwind::begin_unwind::h1003680148821460282
5: 0x7fb8933e13b3 - diagnostic::SpanHandler::span_bug::h1c5c4bceba1974e2FaB
6: 0x7fb893c98523 - session::Session::span_bug::h04e509cfca0af677Qvn
7: 0x7fb894cc60e1 - check::regionck::visit_expr::h6d73f9ea96a73481dCd
8: 0x7fb894cc69fa - check::regionck::visit_local::h94f330bbd6249aa8izd
9: 0x7fb894cc18a5 - check::regionck::Rcx<'a, 'tcx>::visit_fn_body::h91c2ca9bef55fb39qed
10: 0x7fb894d4c566 - check::check_bare_fn::ha0fa7770160c8d54b8m
11: 0x7fb894d44681 - check::check_item::h289f0c28a59d81b7Pqn
12: 0x7fb894e18a03 - check_crate::closure.35785
13: 0x7fb894e1373a - check_crate::h77f9ea673c087f80O3B
14: 0x7fb89662fbf8 - driver::phase_3_run_analysis_passes::h716709d467e74aabqGa
15: 0x7fb896616f59 - driver::compile_input::h56dbe0e66fe8a956Rba
16: 0x7fb8966cea42 - run_compiler::hbbbe30f1ad654d0ex2b
17: 0x7fb8966cc88c - thunk::F.Invoke<A, R>::invoke::h9510793753674638958
18: 0x7fb8966cb910 - rt::unwind::try::try_fn::h15118916039308917284
19: 0x7fb89609ef58 - rust_try_inner
20: 0x7fb89609ef45 - rust_try
21: 0x7fb8966cbdb6 - thunk::F.Invoke<A, R>::invoke::h8595907971712275588
22: 0x7fb89601c995 - sys::thread::thread_start::h9f0c06661d546448B1G
23: 0x7fb88fec2181 - start_thread
24: 0x7fb895bd647c - __clone
25: 0x0 - <unknown>
</code></pre></div> | <p dir="auto">Hello folks,</p>
<p dir="auto">I'm dutifully reporting this as the compiler told me to so. The bug is the same reported already by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="68991886" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/24504" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/24504/hovercard" href="https://github.com/rust-lang/rust/issues/24504">#24504</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59342507" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22897" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22897/hovercard" href="https://github.com/rust-lang/rust/issues/22897">#22897</a>, although it appeared on a different circumstance. I have this simple program (I'm a Rust newbie so It's very likely I'm doing things terribly wrong):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::io::*;
const initial_height: u32 = 1;
fn summer_growth(h: u32) -> u32 {
h + 1
}
fn spring_growth(h: u32) -> u32 {
h * 2
}
fn utopian_tree(cycles: u32) -> u32 {
(0..cycles).fold(|acc, x| grow(acc,x), initial_height);
}
fn grow(acc: u32, cycle: u32) -> u32 {
match cycle % 2 == 0 {
true => spring_growth(acc),
false => summer_growth(acc)
}
}
fn main () {
let mut buf = String::new();
stdin().read_line(&mut buf).unwrap();
let test_cases: u32 = buf.trim().parse().unwrap();
for _ in 0..test_cases {
stdin().read_line(&mut buf).unwrap();
let cycle: u32 = buf.trim().parse().unwrap();
println!("{}", utopian_tree(cycle));
}
}"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>io<span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> initial_height<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">summer_growth</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -> <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
h + <span class="pl-c1">1</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">spring_growth</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -> <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
h <span class="pl-c1">*</span> <span class="pl-c1">2</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">utopian_tree</span><span class="pl-kos">(</span><span class="pl-s1">cycles</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -> <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
<span class="pl-kos">(</span><span class="pl-c1">0</span>..cycles<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">fold</span><span class="pl-kos">(</span>|acc<span class="pl-kos">,</span> x| <span class="pl-en">grow</span><span class="pl-kos">(</span>acc<span class="pl-kos">,</span>x<span class="pl-kos">)</span><span class="pl-kos">,</span> initial_height<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">grow</span><span class="pl-kos">(</span><span class="pl-s1">acc</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">,</span> <span class="pl-s1">cycle</span><span class="pl-kos">:</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span> -> <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
<span class="pl-k">match</span> cycle % <span class="pl-c1">2</span> == <span class="pl-c1">0</span> <span class="pl-kos">{</span>
<span class="pl-c1">true</span> => <span class="pl-en">spring_growth</span><span class="pl-kos">(</span>acc<span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c1">false</span> => <span class="pl-en">summer_growth</span><span class="pl-kos">(</span>acc<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-k">mut</span> buf = <span class="pl-smi">String</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">read_line</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> buf<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> test_cases<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = buf<span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> _ <span class="pl-k">in</span> <span class="pl-c1">0</span>..test_cases <span class="pl-kos">{</span>
<span class="pl-en">stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">read_line</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> buf<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> cycle<span class="pl-kos">:</span> <span class="pl-smi">u32</span> = buf<span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">unwrap</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, utopian_tree<span class="pl-kos">(</span>cycle<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Expected outcome:</p>
<ul dir="auto">
<li>The compile to tell me how wrong I am</li>
</ul>
<p dir="auto">Actual outcome:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁ algorithms rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14 (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/
beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149"><pre class="notranslate"><code class="notranslate">☁ algorithms rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14 (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/
beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149
</code></pre></div>
<p dir="auto">Meta</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁ algorithms rustc --version --verbose
rustc 1.0.0-beta.2 (e9080ec39 2015-04-16) (built 2015-04-16)
binary: rustc
commit-hash: e9080ec39d9a44eb0773d648b348575b19f655e5
commit-date: 2015-04-16
build-date: 2015-04-16
host: x86_64-apple-darwin
release: 1.0.0-beta.2
☁ algorithms"><pre class="notranslate"><code class="notranslate">☁ algorithms rustc --version --verbose
rustc 1.0.0-beta.2 (e9080ec39 2015-04-16) (built 2015-04-16)
binary: rustc
commit-hash: e9080ec39d9a44eb0773d648b348575b19f655e5
commit-date: 2015-04-16
build-date: 2015-04-16
host: x86_64-apple-darwin
release: 1.0.0-beta.2
☁ algorithms
</code></pre></div>
<p dir="auto">Shows up with latest beta as well:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="☁ algorithms rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14 (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149
☁ algorithms rustc --verbose --version
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-04-30
host: x86_64-apple-darwin
release: 1.0.0-beta.4
☁ algorithms"><pre class="notranslate"><code class="notranslate">☁ algorithms rustc utopian_tree.rs -o utopian_tree
utopian_tree.rs:14:5: 14:59 error: internal compiler error: cat_expr Errd
utopian_tree.rs:14 (0..cycles).fold(|acc, x| grow(acc,x), initial_height);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:149
☁ algorithms rustc --verbose --version
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
binary: rustc
commit-hash: 850151a75709f146addd30bbbf1f23d384f0b381
commit-date: 2015-04-30
build-date: 2015-04-30
host: x86_64-apple-darwin
release: 1.0.0-beta.4
☁ algorithms
</code></pre></div> | 1 |
<p dir="auto">I have just installed tensorflow 1 and when I try to run a program I get following errors.<br>
"C:\Users\CRCV>python a.py<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions<br>
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots<br>
b'hello tf'"<br>
Any help?<br>
NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.</p>
<p dir="auto">For general support from the community, see <a href="https://stackoverflow.com/questions/tagged/tensorflow" rel="nofollow">StackOverflow</a>.<br>
To make bugs and feature requests more easy to find and organize, we close issues that are deemed<br>
out of scope for GitHub Issues and point people to StackOverflow.</p>
<p dir="auto">For bugs or installation issues, please provide the following information.<br>
The more information you provide, the more easily we will be able to offer<br>
help and advice.</p>
<h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3>
<h3 dir="auto">Environment info</h3>
<p dir="auto">Operating System:</p>
<p dir="auto">Installed version of CUDA and cuDNN:<br>
(please attach the output of <code class="notranslate">ls -l /path/to/cuda/lib/libcud*</code>):</p>
<p dir="auto">If installed from binary pip package, provide:</p>
<ol dir="auto">
<li>A link to the pip package you installed:</li>
<li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.</li>
</ol>
<p dir="auto">If installed from source, provide</p>
<ol dir="auto">
<li>The commit hash (<code class="notranslate">git rev-parse HEAD</code>)</li>
<li>The output of <code class="notranslate">bazel version</code></li>
</ol>
<h3 dir="auto">If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)</h3>
<h3 dir="auto">What other attempted solutions have you tried?</h3>
<h3 dir="auto">Logs or other output that would be helpful</h3>
<p dir="auto">(If logs are large, please upload as attachment or provide link).</p> | <p dir="auto">I installed TensorFlow version 1.0.0-rc2 on Windows 7 SP1 x64 Ultimate (Python 3.5.2 |Anaconda custom (64-bit)) using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl"><pre class="notranslate"><code class="notranslate">pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl
</code></pre></div>
<p dir="auto">When I try running the test script from <a href="https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation" rel="nofollow">https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation</a> in Eclipse 4.5 or in the console:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import tensorflow as tf
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))"><pre class="notranslate"><code class="notranslate">import tensorflow as tf
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
</code></pre></div>
<p dir="auto">I obtain some error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TensorFlow version: 1.0.0-rc2
'Hello, TensorFlow!'
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflob
w\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots"><pre class="notranslate"><code class="notranslate">TensorFlow version: 1.0.0-rc2
'Hello, TensorFlow!'
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflob
w\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots
</code></pre></div>
<p dir="auto">Why?</p>
<p dir="auto">I didn't have such issues with TensorFlow 0.12.1 (installed with <code class="notranslate">pip install tensorflow==0.12.1</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TensorFlow version: 0.12.1
b'Hello, TensorFlow!'"><pre class="notranslate"><code class="notranslate">TensorFlow version: 0.12.1
b'Hello, TensorFlow!'
</code></pre></div>
<p dir="auto">Stack Exchange thread: <a href="http://stackoverflow.com/q/42217532/395857" rel="nofollow">TensorFlow version 1.0.0-rc2 on Windows: "OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits" with test code</a></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/drpngx/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/drpngx">@drpngx</a></p> | 1 |
<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/codegastudio/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/codegastudio">@codegastudio</a> on November 12, 2016 9:3</em></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">Letsencrypt</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0
config file =
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
config file =
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">None</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">MacOS Sierra to Ubuntu 14.04.2 LTS trusty</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Follow steps describe in <a href="https://docs.ansible.com/ansible/letsencrypt_module.html" rel="nofollow">letsencrypt_module</a> and get error</p>
<blockquote>
<p dir="auto">Error creating new cert :: Certificate public key must be different than account key</p>
</blockquote>
<p dir="auto">At first run, i get error during ' letsencrypt step two'.<br>
At second run, error appear during ' letsencrypt step one'.<br>
At any time crt file is created.<br>
curl access fine to challenge.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---
- stat: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
register: rsa_key_file
tags: letsencrypt
- stat: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
register: csr_file
tags: letsencrypt
- name: create letsencrypt SSL repository
file: >
path=/home/{{ user }}/ssl
state=directory
mode=0755
owner={{ user }}
group={{ user }}
tags: letsencrypt
- name: generate RSA key
command: openssl genrsa -out /home/{{ user }}/ssl/{{ inventory_hostname }}.key 2048
when: rsa_key_file.stat.exists == False
- name: change KEY owner
file: >
path=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
owner={{ user }}
group={{ user }}
tags: letsencrypt
- name: generate CSR
command: openssl req -new -sha256 -key /home/{{ user }}/ssl/{{ inventory_hostname }}.key -out /home/{{ user }}/ssl/{{ inventory_hostname }}.csr -passin pass:{{ letsencrypt.csr_pass_phrase }} -subj {{ letsencrypt.csr_subj }}
when: csr_file.stat.exists == False
tags: letsencrypt
- name: change CSR owner
file: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr owner={{ user }} group={{ user }}
tags: letsencrypt
- name: letsencrypt step one
letsencrypt: >
account_key=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
csr=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
dest=/home/{{ user }}/ssl/{{ inventory_hostname }}.crt
remaining_days={{ letsencrypt.ssl_days_duration }}
account_email={{ letsencrypt.account_email }}
register: sample_com_challenge
tags: letsencrypt
- name: create letsencrypt challenge data repository
file: >
path=/home/{{ user }}/challenges/{{ sample_com_challenge['challenge_data'][ inventory_hostname]['http-01']['resource'] | dirname }}
state=directory
mode=0755
owner={{ user }}
group={{ user }}
recurse=yes
tags: letsencrypt
- name: copy challenge data in directory
copy: >
dest=/home/{{ user }}/challenges/{{ sample_com_challenge['challenge_data'][ inventory_hostname]['http-01']['resource'] }}
content="{{ sample_com_challenge['challenge_data'][inventory_hostname]['http-01']['resource_value'] }}"
owner={{ user }}
group={{ user }}
when: sample_com_challenge|changed
tags: letsencrypt
- name: letsencrypt step two
letsencrypt: >
account_key=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
csr=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
dest=/home/{{ user }}/ssl/{{ inventory_hostname }}.crt
data={{ sample_com_challenge }}
remaining_days={{ letsencrypt.ssl_days_duration }}
account_email={{ letsencrypt.account_email }}
when: sample_com_challenge
tags: letsencrypt"><pre class="notranslate"><code class="notranslate">---
- stat: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
register: rsa_key_file
tags: letsencrypt
- stat: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
register: csr_file
tags: letsencrypt
- name: create letsencrypt SSL repository
file: >
path=/home/{{ user }}/ssl
state=directory
mode=0755
owner={{ user }}
group={{ user }}
tags: letsencrypt
- name: generate RSA key
command: openssl genrsa -out /home/{{ user }}/ssl/{{ inventory_hostname }}.key 2048
when: rsa_key_file.stat.exists == False
- name: change KEY owner
file: >
path=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
owner={{ user }}
group={{ user }}
tags: letsencrypt
- name: generate CSR
command: openssl req -new -sha256 -key /home/{{ user }}/ssl/{{ inventory_hostname }}.key -out /home/{{ user }}/ssl/{{ inventory_hostname }}.csr -passin pass:{{ letsencrypt.csr_pass_phrase }} -subj {{ letsencrypt.csr_subj }}
when: csr_file.stat.exists == False
tags: letsencrypt
- name: change CSR owner
file: path=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr owner={{ user }} group={{ user }}
tags: letsencrypt
- name: letsencrypt step one
letsencrypt: >
account_key=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
csr=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
dest=/home/{{ user }}/ssl/{{ inventory_hostname }}.crt
remaining_days={{ letsencrypt.ssl_days_duration }}
account_email={{ letsencrypt.account_email }}
register: sample_com_challenge
tags: letsencrypt
- name: create letsencrypt challenge data repository
file: >
path=/home/{{ user }}/challenges/{{ sample_com_challenge['challenge_data'][ inventory_hostname]['http-01']['resource'] | dirname }}
state=directory
mode=0755
owner={{ user }}
group={{ user }}
recurse=yes
tags: letsencrypt
- name: copy challenge data in directory
copy: >
dest=/home/{{ user }}/challenges/{{ sample_com_challenge['challenge_data'][ inventory_hostname]['http-01']['resource'] }}
content="{{ sample_com_challenge['challenge_data'][inventory_hostname]['http-01']['resource_value'] }}"
owner={{ user }}
group={{ user }}
when: sample_com_challenge|changed
tags: letsencrypt
- name: letsencrypt step two
letsencrypt: >
account_key=/home/{{ user }}/ssl/{{ inventory_hostname }}.key
csr=/home/{{ user }}/ssl/{{ inventory_hostname }}.csr
dest=/home/{{ user }}/ssl/{{ inventory_hostname }}.crt
data={{ sample_com_challenge }}
remaining_days={{ letsencrypt.ssl_days_duration }}
account_email={{ letsencrypt.account_email }}
when: sample_com_challenge
tags: letsencrypt
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto"><strong>letsencrypt step two</strong> (first run)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [mydomain.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"account_email": "account email",
"account_key": "/path/to/mydomain.com.key",
"acme_directory": "https://acme-staging.api.letsencrypt.org/directory",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf",
"challenge": "http-01",
"csr": "/path/to/mydomain.com.csr",
"data": {
"authorizations": [
{
"challenges": [
{
"status": "pending",
"token": "3lrXt6Z4BoiG1-chtNQN5qp1NpZSPxsqMO_fXrsVkUg",
"type": "dns-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834820"
},
{
"status": "pending",
"token": "fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8",
"type": "http-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834821"
},
{
"status": "pending",
"token": "WLsp235f8mMR6vDMFSKvPFD4ksb3Ih-6cLExV2nZuo0",
"type": "tls-sni-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834822"
}
],
"combinations": [
[
1
],
[
2
],
[
0
]
],
"expires": "2016-11-19T08:50:42.20041263Z",
"identifier": {
"type": "dns",
"value": "mydomain.com"
},
"status": "pending",
"uri": "https://acme-staging.api.letsencrypt.org/acme/authz/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4"
}
],
"cert_days": -1,
"challenge_data": {
"mydomain.com": {
"dns-01": {
"resource": "_acme-challenge",
"resource_value": "IcS0IrdJ1Y18Ss0E751NsxQW2Pac9HqHPVLYr95CE4s"
},
"http-01": {
"resource": ".well-known/acme-challenge/fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8",
"resource_value": "fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8.oBDu6v-YxqIYLfJ80VhCzjYW2UyoK9P6HuZP0IkENAc"
}
}
},
"changed": true
},
"dest": "/path/to/mydomain.com.crt",
"remaining_days": 365
},
"module_name": "letsencrypt"
},
"msg": "Error new cert: CODE: 400 RESULT: {\n \"type\": \"urn:acme:error:malformed\",\n \"detail\": \"Error creating new cert :: Certificate public key must be different than account key\",\n \"status\": 400\n}"
}"><pre class="notranslate"><code class="notranslate">fatal: [mydomain.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"account_email": "account email",
"account_key": "/path/to/mydomain.com.key",
"acme_directory": "https://acme-staging.api.letsencrypt.org/directory",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf",
"challenge": "http-01",
"csr": "/path/to/mydomain.com.csr",
"data": {
"authorizations": [
{
"challenges": [
{
"status": "pending",
"token": "3lrXt6Z4BoiG1-chtNQN5qp1NpZSPxsqMO_fXrsVkUg",
"type": "dns-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834820"
},
{
"status": "pending",
"token": "fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8",
"type": "http-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834821"
},
{
"status": "pending",
"token": "WLsp235f8mMR6vDMFSKvPFD4ksb3Ih-6cLExV2nZuo0",
"type": "tls-sni-01",
"uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4/16834822"
}
],
"combinations": [
[
1
],
[
2
],
[
0
]
],
"expires": "2016-11-19T08:50:42.20041263Z",
"identifier": {
"type": "dns",
"value": "mydomain.com"
},
"status": "pending",
"uri": "https://acme-staging.api.letsencrypt.org/acme/authz/hoWJesKjyhFDejgmLdr5OeYw0DnjNxu4Q3km6MvO5C4"
}
],
"cert_days": -1,
"challenge_data": {
"mydomain.com": {
"dns-01": {
"resource": "_acme-challenge",
"resource_value": "IcS0IrdJ1Y18Ss0E751NsxQW2Pac9HqHPVLYr95CE4s"
},
"http-01": {
"resource": ".well-known/acme-challenge/fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8",
"resource_value": "fmbH41Un6qNaAscvfWRgTjeyqepRGC5bE75Ok5tlrW8.oBDu6v-YxqIYLfJ80VhCzjYW2UyoK9P6HuZP0IkENAc"
}
}
},
"changed": true
},
"dest": "/path/to/mydomain.com.crt",
"remaining_days": 365
},
"module_name": "letsencrypt"
},
"msg": "Error new cert: CODE: 400 RESULT: {\n \"type\": \"urn:acme:error:malformed\",\n \"detail\": \"Error creating new cert :: Certificate public key must be different than account key\",\n \"status\": 400\n}"
}
</code></pre></div>
<p dir="auto"><strong>letsencrypt step one</strong> (second run)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [mydomain.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"account_email": "account email",
"account_key": "/path/to/mydomain.com.key",
"acme_directory": "https://acme-staging.api.letsencrypt.org/directory",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf",
"challenge": "http-01",
"csr": "/path/to/mydomain.com.csr",
"data": null,
"dest": "/path/to/mydomain.com.crt",
"remaining_days": 365
},
"module_name": "letsencrypt"
},
"msg": "Error new cert: CODE: 400 RESULT: {\n \"type\": \"urn:acme:error:malformed\",\n \"detail\": \"Error creating new cert :: Certificate public key must be different than account key\",\n \"status\": 400\n}"
}"><pre class="notranslate"><code class="notranslate">fatal: [mydomain.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"account_email": "account email",
"account_key": "/path/to/mydomain.com.key",
"acme_directory": "https://acme-staging.api.letsencrypt.org/directory",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf",
"challenge": "http-01",
"csr": "/path/to/mydomain.com.csr",
"data": null,
"dest": "/path/to/mydomain.com.crt",
"remaining_days": 365
},
"module_name": "letsencrypt"
},
"msg": "Error new cert: CODE: 400 RESULT: {\n \"type\": \"urn:acme:error:malformed\",\n \"detail\": \"Error creating new cert :: Certificate public key must be different than account key\",\n \"status\": 400\n}"
}
</code></pre></div>
<p dir="auto"><em>Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="188901441" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/3444" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/3444/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/3444">ansible/ansible-modules-extras#3444</a></em></p> | <p dir="auto">When running this task</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: 'Subversion | Install SSH user public keys'
authorized_key: user=sshsvn
key="{{lookup('file', inventory_dir + '/files/certs/' + item + '.svn.pub')}}"
key_options='command="/usr/local/bin/svnserve -t --tunnel-user={{item}}",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty'
with_items: svn_user"><pre class="notranslate"><code class="notranslate">- name: 'Subversion | Install SSH user public keys'
authorized_key: user=sshsvn
key="{{lookup('file', inventory_dir + '/files/certs/' + item + '.svn.pub')}}"
key_options='command="/usr/local/bin/svnserve -t --tunnel-user={{item}}",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty'
with_items: svn_user
</code></pre></div>
<p dir="auto">then the key options are no longer added to the ~/.ssh/authorized_keys file on the remote host anymore. This used to be working prior to version 1.4 final but is no longer working since. Tested against 1.4.1, 1.4.3 and 1.5dev/HEAD.</p>
<p dir="auto">To reproduce, simply run the above task where the variable svn_user is a list of usernames as strings and the file "item.svn.pub" is a SSH RSA public key file.</p> | 0 |
<p dir="auto">I'd like to read audio file by using a sox utility directly. Currently I can do it as:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="signal = torch.from_numpy(np.frombuffer(subprocess.check_output(['sox', '-V0', audio_path, '-b', '16', '-e', 'signed', '--endian', 'little', '-r', str(sample_rate), '-c', '1', '-t', 'raw', '-'], dtype = np.int16))"><pre class="notranslate"><span class="pl-s1">signal</span> <span class="pl-c1">=</span> <span class="pl-s1">torch</span>.<span class="pl-s1">from_numpy</span>(<span class="pl-s1">np</span>.<span class="pl-en">frombuffer</span>(<span class="pl-s1">subprocess</span>.<span class="pl-en">check_output</span>([<span class="pl-s">'sox'</span>, <span class="pl-s">'-V0'</span>, <span class="pl-s1">audio_path</span>, <span class="pl-s">'-b'</span>, <span class="pl-s">'16'</span>, <span class="pl-s">'-e'</span>, <span class="pl-s">'signed'</span>, <span class="pl-s">'--endian'</span>, <span class="pl-s">'little'</span>, <span class="pl-s">'-r'</span>, <span class="pl-en">str</span>(<span class="pl-s1">sample_rate</span>), <span class="pl-s">'-c'</span>, <span class="pl-s">'1'</span>, <span class="pl-s">'-t'</span>, <span class="pl-s">'raw'</span>, <span class="pl-s">'-'</span>], <span class="pl-s1">dtype</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">int16</span>))</pre></div>
<p dir="auto">Is there a way to reinterpret a torch byte tensor (or python's <code class="notranslate">bytearray(...)</code>) as another type without invoking first NumPy? (or a generic numpy.view(dtype) functionality) If not, I think it'd be quite useful (mainly for integral types, but also maybe for some integer bit-tricks on float32 tensors, which can hopefully be fused by jit)</p>
<p dir="auto">Also reported in <a href="https://discuss.pytorch.org/t/reinterpret-pytorch-array-as-a-different-dtype/24256" rel="nofollow">https://discuss.pytorch.org/t/reinterpret-pytorch-array-as-a-different-dtype/24256</a></p>
<p dir="auto">This probably can also be helpful for conversions between complex <-> pair or real/imag.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mruberry/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mruberry">@mruberry</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rgommers/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rgommers">@rgommers</a></p> | <p dir="auto">We support many built-in functions (<a href="https://docs.python.org/2/library/functions.html" rel="nofollow">Python 2</a>, <a href="https://docs.python.org/3/library/functions.html" rel="nofollow">Python 3</a>), but not all of them. Some of these need some more discussion (i.e. what about builtins that exist in Python 2 but not 3 and vice versa), but many can be done piecemeal and should be straightforward to implement. When you implement a builtin please check to see if it is a <a href="https://rszalski.github.io/magicmethods/" rel="nofollow">magic method</a>.</p>
<p dir="auto">To do</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">abs()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">all()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">any()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">bin()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">bool()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">bytearray()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">chr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">dict()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">divmod()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">enumerate()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">float()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">getattr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">hash()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">hex()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">int()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">isinstance()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">len()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">list()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">long()</code> (long is deprecated in py3 builtins)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">max()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">min()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">oct()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">ord()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">pow()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">print()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">range()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">reversed()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">round()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">set()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">slice()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">sorted()</code> (<a href="https://github.com/pytorch/pytorch/issues/19372" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/19372/hovercard">separate issue</a>, implemented for lists)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">str()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">sum()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">type()</code></li>
</ul>
<p dir="auto">Maybe to do later (when things like first class modules are in, or if we ever have something like iterators)</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">callable()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">tuple()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">complex()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">delattr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">filter()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">format()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">frozenset()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">globals()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">hasattr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">issubclass()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">iter()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">locals()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">next()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">object()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">property()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">reduce()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">setattr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">repr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">super()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">vars()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <code class="notranslate">zip()</code></li>
</ul>
<p dir="auto">Probably won't do</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">__import__()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">basestring()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">classmethod()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">cmp()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">compile()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">dir()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">eval()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">execfile()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">file()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">help()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">id()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">input()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">map()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">memoryview()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">open()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">raw_input()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">reload()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">staticmethod()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">unichr()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">unicode()</code></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">xrange()</code></li>
</ul>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/suo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/suo">@suo</a></p> | 0 |
<p dir="auto">Coming from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="33275467" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/2177" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/2177/hovercard" href="https://github.com/atom/atom/issues/2177">atom/atom#2177</a>, it seems atom retrieves pre-built libraries for atom-shell, which I'm guessing were built in Ubuntu.</p>
<p dir="auto">Trying to build atom-shell from source fails (please see details in linked issue).</p> | <p dir="auto">We should provide a script to build libchromiumcontent and atom-shell from source code, and make use of <a href="https://build.opensuse.org" rel="nofollow">OpenSUSE Build Service</a> to compile and provide Linux packages.</p> | 1 |
<h2 dir="auto">In 4.1.1, non-sharding-table SQL do not supported nested subquery,</h2>
<p dir="auto">I'm sorry for the bad reading experience. I translated the English with Google and made some adjustments.</p>
<p dir="auto">this nested subquery has nothing to do with the table I want to sharing.<br>
For example, if the table to be sharding is "log" ,<br>
and a SQL String not contain "log",<br>
like<br>
select<br>
*<br>
from (select<br>
...<br>
from<br>
(select<br>
*<br>
from user<br>
union<br>
select<br>
*<br>
from account<br>
)t left join........<br>
) temp where......<br>
when I run the SQL , I will get the error message "Can not find owner from table",<br>
related code: ProjectionsContextEngine.find(), line 197, throw new IllegalStateException("Can not find owner from table.")</p>
<p dir="auto">This SQL does not contain the table to be sharding. Why is it parsed?<br>
Similar to "SQLString.contains("log")?doSharding():doDefault()",<br>
Does it have such a function? I didn't find it.<br>
I think the SQL that are not sharding do not need to be processed by sharding-jdbc.</p> | <h3 dir="auto">Which version of Sharding-Jdbc do you using?(您使用的Sharding-Jdbc版本为?)</h3>
<p dir="auto">Sharding-Jdbc版本:2.0.3</p>
<h3 dir="auto">Expected behavior (您预期的结果是)</h3>
<p dir="auto">希望可以集成到springboot2.0</p>
<h3 dir="auto">Actual behavior (实际运行的结果是)</h3>
<p dir="auto">报错:java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver</p>
<p dir="auto">原因springboot2.0中RelaxedPropertyResolver不再可用了</p> | 0 |
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
When trying to rehydrate markup in IE11 'Argument is not optional' error is thrown. It happens only if component has dangerouslySetInnerHTML prop.</p>
<p dir="auto"><strong>Example</strong><br>
<a href="https://jsfiddle.net/oy9awLtq/" rel="nofollow">https://jsfiddle.net/oy9awLtq/</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
No error should be thrown</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong><br>
React version: 16<br>
Browser: IE11</p> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">React interactivity lost, React crash?</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via <a href="https://jsfiddle.net" rel="nofollow">https://jsfiddle.net</a> or similar (template: <a href="https://jsfiddle.net/ebsrpraL/" rel="nofollow">https://jsfiddle.net/ebsrpraL/</a>).</strong></p>
<p dir="auto">Run with react-dom.development.js in IE11, not sure exactly what the exact repo steps are the fix I've attempted for IE11 was to simply pass an empty string.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var normalizeHTML = function (parent, html) {
if (!testDocument) {
testDocument = document.implementation.createHTMLDocument(""); // fix for IE11 here
}
var testElement = parent.namespaceURI === HTML_NAMESPACE ? testDocument.createElement(parent.tagName) : testDocument.createElementNS(parent.namespaceURI, parent.tagName);
testElement.innerHTML = html;
return testElement.innerHTML;
};
}"><pre class="notranslate"><code class="notranslate">var normalizeHTML = function (parent, html) {
if (!testDocument) {
testDocument = document.implementation.createHTMLDocument(""); // fix for IE11 here
}
var testElement = parent.namespaceURI === HTML_NAMESPACE ? testDocument.createElement(parent.tagName) : testDocument.createElementNS(parent.namespaceURI, parent.tagName);
testElement.innerHTML = html;
return testElement.innerHTML;
};
}
</code></pre></div>
<p dir="auto">Source </p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/facebook/react/blob/e932ad68bed656eed5295b61ba74e5d0857902ed/src/renderers/dom/fiber/ReactDOMFiberComponent.js#L133-L146">react/src/renderers/dom/fiber/ReactDOMFiberComponent.js</a>
</p>
<p class="mb-0 color-fg-muted">
Lines 133 to 146
in
<a data-pjax="true" class="commit-tease-sha" href="/facebook/react/commit/e932ad68bed656eed5295b61ba74e5d0857902ed">e932ad6</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L133" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="133"></td>
<td id="LC133" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">var</span> <span class="pl-en">normalizeHTML</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">parent</span>: <span class="pl-v">Element</span><span class="pl-kos">,</span> <span class="pl-s1">html</span>: <span class="pl-s1">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
</tr>
<tr class="border-0">
<td id="L134" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="134"></td>
<td id="LC134" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">testDocument</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
</tr>
<tr class="border-0">
<td id="L135" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="135"></td>
<td id="LC135" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">testDocument</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">implementation</span><span class="pl-kos">.</span><span class="pl-en">createHTMLDocument</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L136" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="136"></td>
<td id="LC136" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
</tr>
<tr class="border-0">
<td id="L137" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="137"></td>
<td id="LC137" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">var</span> <span class="pl-s1">testElement</span> <span class="pl-c1">=</span> <span class="pl-s1">parent</span><span class="pl-kos">.</span><span class="pl-c1">namespaceURI</span> <span class="pl-c1">===</span> <span class="pl-c1">HTML_NAMESPACE</span> </td>
</tr>
<tr class="border-0">
<td id="L138" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="138"></td>
<td id="LC138" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> ? <span class="pl-s1">testDocument</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s1">parent</span><span class="pl-kos">.</span><span class="pl-c1">tagName</span><span class="pl-kos">)</span> </td>
</tr>
<tr class="border-0">
<td id="L139" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="139"></td>
<td id="LC139" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> : <span class="pl-s1">testDocument</span><span class="pl-kos">.</span><span class="pl-en">createElementNS</span><span class="pl-kos">(</span> </td>
</tr>
<tr class="border-0">
<td id="L140" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="140"></td>
<td id="LC140" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">(</span><span class="pl-s1">parent</span><span class="pl-kos">.</span><span class="pl-c1">namespaceURI</span>: <span class="pl-s1">any</span><span class="pl-kos">)</span><span class="pl-kos">,</span> </td>
</tr>
<tr class="border-0">
<td id="L141" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="141"></td>
<td id="LC141" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">parent</span><span class="pl-kos">.</span><span class="pl-c1">tagName</span><span class="pl-kos">,</span> </td>
</tr>
<tr class="border-0">
<td id="L142" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="142"></td>
<td id="LC142" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L143" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="143"></td>
<td id="LC143" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">testElement</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">=</span> <span class="pl-s1">html</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L144" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="144"></td>
<td id="LC144" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-s1">testElement</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L145" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="145"></td>
<td id="LC145" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L146" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="146"></td>
<td id="LC146" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">MDN docs <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument" rel="nofollow">here</a>.</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Well, that React does not crash in dev mode and that interactively continues to work.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong></p>
<p dir="auto"><code class="notranslate">[email protected]</code> IE11</p> | 1 |
<p dir="auto">This was fun to debug.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: 0 in pd.Int64Index([0, 0, 1])
Out[2]: True
In [3]: 0 in pd.Int64Index([0, 1, 0])
Out[3]: True
In [4]: 0 in pd.Int64Index([0, 0, -1])
Out[4]: True
In [5]: pd.Timestamp(0) in pd.DatetimeIndex([0, 1, -1])
Out[5]: True
In [6]: pd.Timestamp(0) in pd.DatetimeIndex([0, 1, 0])
Out[6]: False # BAD
In [7]: pd.Timestamp(0) in pd.DatetimeIndex([0, 0, 1])
Out[7]: True
In [8]: pd.Timestamp(0) in pd.DatetimeIndex([0, 0, -1])
Out[8]: False # BAD"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-c1">0</span> <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">Int64Index</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">2</span>]: <span class="pl-c1">True</span>
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-c1">0</span> <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">Int64Index</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: <span class="pl-c1">True</span>
<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-c1">0</span> <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">Int64Index</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-c1">True</span>
<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-c1">0</span>) <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">DatetimeIndex</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: <span class="pl-c1">True</span>
<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-c1">0</span>) <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">DatetimeIndex</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: <span class="pl-c1">False</span> <span class="pl-c"># BAD</span>
<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-c1">0</span>) <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">DatetimeIndex</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]: <span class="pl-c1">True</span>
<span class="pl-v">In</span> [<span class="pl-c1">8</span>]: <span class="pl-s1">pd</span>.<span class="pl-v">Timestamp</span>(<span class="pl-c1">0</span>) <span class="pl-c1">in</span> <span class="pl-s1">pd</span>.<span class="pl-v">DatetimeIndex</span>([<span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>])
<span class="pl-v">Out</span>[<span class="pl-c1">8</span>]: <span class="pl-c1">False</span> <span class="pl-c"># BAD</span></pre></div>
<p dir="auto">TimedeltaIndex is also broken.</p>
<p dir="auto">The problem is in <a href="https://github.com/pydata/pandas/blob/v0.15.2/pandas/tseries/base.py#L68"><code class="notranslate">DatetimeIndexOpsMixin.__contains__</code></a>, which checks the type of <code class="notranslate">idx.get_loc(key)</code> to determine whether the key was found in the index. If the index contains duplicate entries and is not monotonic increasing (for some reason, monotonic decreasing doesn't cut it), <code class="notranslate">get_loc</code> eventually falls back to <a href="https://github.com/pydata/pandas/blob/v0.15.2/pandas/index.pyx#L376"><code class="notranslate">Int64Engine._maybe_get_bool_indexer</code></a>, which returns an ndarray of bools if the key is duplicated. Since the original <code class="notranslate">__contains__</code> method is looking for scalars or slices, it reports that the duplicated entry is not present.</p> | <h4 dir="auto">Code Sample</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="result = pd.Series(1., pd.date_range('20170101','20181231',freq='D')).resample('B').last().to_period()
print result.index[0]
# Period('2016-12-30', 'B')
pd.Period('20170101', freq='B')
# Period('2017-01-02', 'B')"><pre class="notranslate"><span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-c1">1.</span>, <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'20170101'</span>,<span class="pl-s">'20181231'</span>,<span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'D'</span>)).<span class="pl-en">resample</span>(<span class="pl-s">'B'</span>).<span class="pl-en">last</span>().<span class="pl-en">to_period</span>()
<span class="pl-k">print</span> <span class="pl-s1">result</span>.<span class="pl-s1">index</span>[<span class="pl-c1">0</span>]
<span class="pl-c"># Period('2016-12-30', 'B')</span>
<span class="pl-s1">pd</span>.<span class="pl-v">Period</span>(<span class="pl-s">'20170101'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'B'</span>)
<span class="pl-c"># Period('2017-01-02', 'B')</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">when i have daily data that spans weekends (e.g., 1/1/2017 which is a Sunday) and try to get the last available value for a BusinessDay, the data falls back to the Friday period. This is inconsistent with the timestamp of Sunday belonging to the Monday BusinessDay period (e.g., <code class="notranslate">pd.Period('20170101', 'B')</code> goes to 1/2/2017).</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">I would expect that the <code class="notranslate">result.index[0]</code> above would return <code class="notranslate">Period('2017-01-02', 'B')</code></p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-36-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.7<br>
pip: 9.0.1<br>
setuptools: 34.3.0<br>
Cython: 0.24<br>
numpy: 1.12.0<br>
scipy: 0.18.1<br>
statsmodels: 0.6.1<br>
xarray: 0.9.1<br>
IPython: 4.1.1<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.6.0<br>
pytz: 2016.10<br>
blosc: None<br>
bottleneck: 1.2.0<br>
tables: None<br>
numexpr: 2.5<br>
matplotlib: 1.5.1<br>
openpyxl: 2.3.3<br>
xlrd: 0.9.4<br>
xlwt: 1.0.0<br>
xlsxwriter: None<br>
lxml: 3.5.0<br>
bs4: 4.5.1<br>
html5lib: None<br>
httplib2: 0.9.2<br>
apiclient: None<br>
sqlalchemy: 1.0.12<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: 2.45.0<br>
pandas_datareader: None</p>
</details> | 0 |
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">Component Name:</h5>
<p dir="auto">core</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">$ ansible --version<br>
ansible 2.0.0.2<br>
config file = /home/damjan/sys-ops/ansible.cfg<br>
configured module search path = Default w/o overrides</p>
<h5 dir="auto">Ansible Configuration:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ask_vault_pass = true
become = true"><pre class="notranslate"><code class="notranslate">ask_vault_pass = true
become = true
</code></pre></div>
<h5 dir="auto">Summary:</h5>
<p dir="auto">the ansible.cfg file has <code class="notranslate">become=true</code> and <code class="notranslate">ask_vault_pass=true</code> but in rare situations I need to run <code class="notranslate">ansible</code> without the vault or sudo requirements. It would need to have something like <code class="notranslate">--no-become</code> and <code class="notranslate">--no-ask-vault-pass</code> or <code class="notranslate">--become=false</code> to be able to revert the defaults from the config file.</p> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">lib/ansible/playbook/play_context.py<br>
lib/ansible/playbook/become.py</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="devel"><pre class="notranslate"><code class="notranslate">devel
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">PlayContext defined its own become attributes: <a href="https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/play_context.py#L194">https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/play_context.py#L194</a></p>
<p dir="auto">but we have a Become mixin which does that: <a href="https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/become.py#L33">https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/become.py#L33</a></p>
<p dir="auto">Is there a reason for this or should we switch PlayContext to use the mixin?</p>
<p dir="auto">Note: the answer could be that play_context is actually not like the other objects in playbook/ at all. (In which case... we should probably be moving to separate it more rather than integrating it tighter with an abstraction that's an imperfect fit.)</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Look at play_context.py and become.py to see that they're defining the same attributes but not</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">No code duplication; logical structure</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div> | 0 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0.0
config file = /home/soar/ansible2/ansible.cfg
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.0.0
config file = /home/soar/ansible2/ansible.cfg
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When I build new project with Ansible, I place all sensitive information to vault-encrypted files. I follow KISS principles and this files are included as <code class="notranslate">group_vars</code> (or <code class="notranslate">host_vars</code>). All works perfectly. So I have files like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="├── ansible.cfg
├── inventory
│ └── projectname
│ ├── group_vars
│ │ ├── hosts.yml
│ │ ├── somegroup.yml
│ │ └── somegroup-encrypted.yml
│ └── projectname
├── playbooks
│ ├── deploy-something.yml
│ └── test.yml
└── roles
├── somerole
│ ├── defaults
│ │ └── main.yml"><pre class="notranslate"><code class="notranslate">├── ansible.cfg
├── inventory
│ └── projectname
│ ├── group_vars
│ │ ├── hosts.yml
│ │ ├── somegroup.yml
│ │ └── somegroup-encrypted.yml
│ └── projectname
├── playbooks
│ ├── deploy-something.yml
│ └── test.yml
└── roles
├── somerole
│ ├── defaults
│ │ └── main.yml
</code></pre></div>
<p dir="auto">But recently I started to use automated tests for my Ansible projects. So after commiting to repository, I run something like:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ansible-playbook -vvv --syntax-check playbooks/test.yml
ansible-playbook -vvv --connection=local --sudo playbooks/test.yml"><pre class="notranslate">ansible-playbook -vvv --syntax-check playbooks/test.yml
ansible-playbook -vvv --connection=local --sudo playbooks/test.yml</pre></div>
<p dir="auto">And check output. I want to run this tests without my encrypted data, and all variables are defined with default values in <code class="notranslate">rolename/defaults/main.yml</code>. But... I get only <code class="notranslate">ERROR! Decryption failed</code>.</p>
<p dir="auto">I think, there should be some command-line switch, to run playbook without decryption for test purposes.</p>
<p dir="auto">I know, that I can use <code class="notranslate">vars_files</code> or <code class="notranslate">-e</code> command-line switch, but then I should type them on every run. And I think encrypted files should be places in <code class="notranslate">inventory</code> with appropriate hosts, and not in playbooks directory.</p>
<p dir="auto">And, of course, please don't forget about <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="137563299" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/14721" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/14721/hovercard" href="https://github.com/ansible/ansible/issues/14721">#14721</a></p> | <p dir="auto">In some cases diff users might want to use the same play with different access levels, being able to change vault failure to decrypt to a warning or something else allows for this.</p> | 1 |
<p dir="auto">When using mysql as URI scheme in caravel_config.py, everything works fine.<br>
I could add druid cluster. When I try to refresh druid metadata, it throws following error:</p>
<p dir="auto">sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (_mysql_exceptions.IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (<code class="notranslate">caravel</code>.<code class="notranslate">columns</code>, CONSTRAINT <code class="notranslate">columns_ibfk_1</code> FOREIGN KEY (<code class="notranslate">column_name</code>) REFERENCES <code class="notranslate">datasources</code> (<code class="notranslate">datasource_name</code>))')</p>
<p dir="auto">On debugging, I figured out that while calling sync_to_db, DruidDatasource is trying to modify DruidColumn which I understand is not allowed.</p>
<p dir="auto">Could some one help me if I am doing something wrong or is it a valid issue.</p>
<p dir="auto">OS: Ubuntu 14.04<br>
Druid: 0.9<br>
Caravel: 0.9</p>
<p dir="auto">Steps to reproduce.</p>
<ol dir="auto">
<li>Change URI scheme to mysql as instructed in tutorial. Follow tutorial.</li>
<li>Add Druid cluster.</li>
<li>Do Druid Refresh Metadata.</li>
</ol> | <p dir="auto">In the commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/superset/commit/c2bb49fec567c72f9752f99db783225787d87eb6/hovercard" href="https://github.com/apache/superset/commit/c2bb49fec567c72f9752f99db783225787d87eb6"><tt>c2bb49f</tt></a>, the foreign key that references datasource.datasource_name was set on columns.column_name when it should be columns.datasource_name. This causes errors when there are any new columns to be created when refreshing the druid datasources.</p>
<p dir="auto">I am trying to generate a migration script to fix this. However, op.drop_constraint() requires the name of the foreign key you want to drop.<br>
The following code works on SQLite because the foreign keys don't have any names:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="naming_convention = {
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
}
def upgrade():
with op.batch_alter_table('columns', schema=None, naming_convention=naming_convention) as batch_op:
fk_name = 'fk_columns_column_name_datasources'
batch_op.drop_constraint(fk_name, type_='foreignkey')
batch_op.create_foreign_key(fk_name, 'datasources',
['datasource_name'], ['datasource_name'])"><pre class="notranslate"><code class="notranslate">naming_convention = {
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
}
def upgrade():
with op.batch_alter_table('columns', schema=None, naming_convention=naming_convention) as batch_op:
fk_name = 'fk_columns_column_name_datasources'
batch_op.drop_constraint(fk_name, type_='foreignkey')
batch_op.create_foreign_key(fk_name, 'datasources',
['datasource_name'], ['datasource_name'])
</code></pre></div>
<p dir="auto">But for MySQL, the foreign keys are named like "columns_ibfk_1". Should I presume that on every machines, this foreign key has the same name and just drop the foreign key named columns_ibfk_1?<br>
Do you have any suggestion about how to write a universal migration script that works on every SQL dialects? Or should I iterate through the known default names in different dialects in try-catch blocks?<br>
I just couldn't figure out a way to drop the foreign key without knowing its name.</p> | 1 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.18363.476
Windows Terminal version (if applicable): 0.6.2951.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18363.476
Windows Terminal version (if applicable): 0.6.2951.0
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<ol dir="auto">
<li>Make sure Windows Terminal is in dark theme and Windows 10 default app mode is light</li>
<li>Open <code class="notranslate">about</code> modal</li>
<li>Highlight some text and right click</li>
</ol>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Context menu should be legible with white text on dark background.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Context menu text is not legible.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16341131/69338535-5375ae80-0c5b-11ea-9bf8-b59d693a5a6f.png"><img src="https://user-images.githubusercontent.com/16341131/69338535-5375ae80-0c5b-11ea-9bf8-b59d693a5a6f.png" alt="Screenshot (35)" style="max-width: 100%;"></a></p> | <h1 dir="auto">Summary of the new feature/enhancement</h1>
<p dir="auto">In Profile.json we will define the <code class="notranslate">actions</code> section.</p>
<p dir="auto">This section is an array and each element takes an Object, the schema can be</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"icon" : "...",
"title" : "...",
"command": "..."
}"><pre class="notranslate">{
<span class="pl-ent">"icon"</span> : <span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>,
<span class="pl-ent">"title"</span> : <span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>,
<span class="pl-ent">"command"</span>: <span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>
}</pre></div>
<p dir="auto">You can add an icon next to the icons at the top right and make the following features.</p>
<ul dir="auto">
<li>
<p dir="auto">A list will open.</p>
</li>
<li>
<p dir="auto">Using the information in <code class="notranslate">actions</code> in Profile.json, it will create the elements of the list and execute a command when we click on it.<br>
I'm leaving a picture to make it more descriptive.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/36041339/61579310-452c5000-ab0c-11e9-99bf-7b6e96fd8214.png"><img src="https://user-images.githubusercontent.com/36041339/61579310-452c5000-ab0c-11e9-99bf-7b6e96fd8214.png" alt="Untitled" style="max-width: 100%;"></a></p>
</li>
</ul>
<p dir="auto">Edit : Where can we find a complete list of shortcut commands that we can use on the Windows-terminal? If there is no such place, is it possible to share in pdf or website form?</p> | 0 |
<h5 dir="auto">Description of the problem</h5>
<p dir="auto">[.Offscreen-For-WebGL-0EAEC5B0]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.<br>
This is what came up in the console:<br>
i tried duplicating the water shader material in codepen</p>
<p dir="auto"><a href="https://codepen.io/marshall_hunts/pen/GEeXJa" rel="nofollow"></a><br>
<a href="https://codepen.io/marshall_hunts/pen/GEeXJa" rel="nofollow">https://codepen.io/marshall_hunts/pen/GEeXJa</a><br>
chrome couldn't load the skybox material but works fine locally</p> | <p dir="auto">my vtk file format like:</p>
<h1 dir="auto">vtk DataFile Version 4.1</h1>
<p dir="auto">3D point save to vtk file<br>
ASCII<br>
DATASET STRUCTURED_POINTS<br>
DIMENSIONS 100 100 100<br>
SPACING 1 1 1<br>
ORIGIN 0 0 0<br>
POINT_DATA 1000000<br>
SCALARS gray_value float 1<br>
LOOKUP_TABLE default<br>
0.364706<br>
0.345098<br>
0.054902<br>
0.654902<br>
0.623529<br>
0.627451<br>
0.333333<br>
0.72549<br>
....<br>
....<br>
My 3D model is a series of grayscale images combined, so the data points have only grayscale values instead of RGB.I don't know if the current vtkloder.js does not support the 4.x version of the vtk file.</p> | 0 |
<p dir="auto">Hello,</p>
<p dir="auto">Cant create session with auth object after upgrading to 1.0.3 used to work in 0.14.2<br>
(This is an interactive session, I replaced < and > with //)</p>
<p dir="auto">Python 2.7.2+ (default, Oct 4 2011, 20:03:08)<br>
[GCC 4.6.1] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.</p>
<blockquote>
<p dir="auto">import requests<br>
requests.<strong>version</strong><br>
'1.0.3'</p>
<p dir="auto">auth = requests.auth.HTTPDigestAuth('admin','1234')<br>
auth<br>
//requests.auth.HTTPDigestAuth object at 0xb715c9ec//</p>
<p dir="auto">requests.session(auth=auth)<br>
Traceback (most recent call last):<br>
File "//stdin//", line 1, in //module//<br>
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 385, in session<br>
return Session(**kwargs)<br>
TypeError: <strong>init</strong>() got an unexpected keyword argument 'auth'</p>
<p dir="auto">requests.session()<br>
//requests.sessions.Session object at 0xb715c9cc//</p>
<p dir="auto">auth=('user', 'pass')<br>
auth<br>
('user', 'pass')</p>
<p dir="auto">requests.session(auth=auth)<br>
Traceback (most recent call last):<br>
File "//stdin//", line 1, in //module//<br>
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 385, in session<br>
return Session(**kwargs)<br>
TypeError: <strong>init</strong>() got an unexpected keyword argument 'auth'</p>
</blockquote> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="requests.session(**kwargs)
Returns a Session for context-management."><pre class="notranslate"><code class="notranslate">requests.session(**kwargs)
Returns a Session for context-management.
</code></pre></div>
<p dir="auto">This not longer works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="session = requests.Session(verify=not staging)
TypeError: __init__() got an unexpected keyword argument 'verify'"><pre class="notranslate"><code class="notranslate">session = requests.Session(verify=not staging)
TypeError: __init__() got an unexpected keyword argument 'verify'
</code></pre></div> | 1 |
<h3 dir="auto">Problem description</h3>
<p dir="auto">CircularProgress is frozen on FF & Safari (I don't have Edge and IE to test that)</p>
<h3 dir="auto">Link to minimal working code that reproduces the issue</h3>
<p dir="auto">Just look at the documentation page: <a href="https://material-ui-1dab0.firebaseapp.com/component-demos/progress" rel="nofollow">https://material-ui-1dab0.firebaseapp.com/component-demos/progress</a></p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>Material-UI: 1.0.0-alpha.17</li>
<li>React: 15.6.0</li>
<li>Browser: Newest on Safari and FF</li>
</ul> | <p dir="auto">Circular progress doesn't work on safari, it looks full.</p>
<p dir="auto">Open next docs in safari.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5749437/20119660/b9dd2a10-a609-11e6-9528-edba5b68f81e.png"><img src="https://cloud.githubusercontent.com/assets/5749437/20119660/b9dd2a10-a609-11e6-9528-edba5b68f81e.png" alt="capture d ecran 2016-11-08 a 23 17 39" style="max-width: 100%;"></a></p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>Material-UI: Next branch</li>
<li>Browser: Safari 9.1.3, 10.1; Firefox 45.8.0</li>
</ul> | 1 |
<p dir="auto">It seems that once emacs parses a <code class="notranslate">'"'</code> (that is, a double-quote character literal), in rust code it interprets this as the beginning of a string and highlights accordingly. This is very easy to spot, for example, in the file <code class="notranslate">src/libextra/json.rs</code> (which is where I discovered it).</p> | <p dir="auto">The latest version of <code class="notranslate">rust-mode</code> for Emacs (20130928.1740) has issues with<br>
single-quoted characters, especially when that character is a <code class="notranslate">"</code> (double<br>
quote). The following program executes correctly in Rust 0.8, but is font-locked<br>
improperly in Emacs:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
println!("{}", '"');
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, <span class="pl-s">'"'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">It treats the double quote as the beginning of a string which runs to the end of<br>
the file. If the double quote character is escaped like so:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
println!("{}", '\"');
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, <span class="pl-s">'\"'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Then there is not a problem with an unterminated string, but the characters<br>
inside the single quotes are not fontified at all.</p>
<p dir="auto">Note: Both programs compile and execute successfully under Rust 0.8.</p>
<p dir="auto">This is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="18609957" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/8793" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/8793/hovercard" href="https://github.com/rust-lang/rust/issues/8793">#8793</a></p> | 1 |
<p dir="auto">I would be willing to contribute a median absolute deviation function to scipy.stats, if there is a broader interest. There are other robust measures of variance (<code class="notranslate">tvar</code> and <code class="notranslate">iqr</code>) and I think the <code class="notranslate">mad</code> function would complement these nicely.</p> | <p dir="auto">Some functions like <code class="notranslate">linregress</code> and <code class="notranslate">theilslopes</code> return tuples of 4 or 5 results. A <code class="notranslate">Bunch</code> pattern would be much cleaner, and also allows adding extra return values easily.</p>
<p dir="auto">See discussion at <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rgommers/scipy/commit/6c1048f6416/hovercard" href="https://github.com/rgommers/scipy/commit/6c1048f6416">rgommers@<tt>6c1048f6416</tt></a> with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/josef-pkt/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/josef-pkt">@josef-pkt</a></p> | 0 |
<p dir="auto">After installing the prerequisites (and setting the following environment variables):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export NO_CUDA=1
export NO_DISTRIBUTED=1
export NO_MKLDNN=1
export NO_NNPACK=1
export NO_QNNPACK=1"><pre class="notranslate"><code class="notranslate">export NO_CUDA=1
export NO_DISTRIBUTED=1
export NO_MKLDNN=1
export NO_NNPACK=1
export NO_QNNPACK=1
</code></pre></div>
<p dir="auto">I could not complete the build with the following command:</p>
<p dir="auto"><code class="notranslate">make -VERBOSE=1</code></p>
<p dir="auto">The tail of the error messages is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/pi/projects/pytorch/build/confu-srcs/pthreadpool/include/pthreadpool.h:223:2: warning: ‘pthreadpool_function_4d_tiled_t’ is deprecated [-Wdeprecated-declarations]
pthreadpool_function_4d_tiled_t function,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccPqf5ia.s: Assembler messages:
/tmp/ccPqf5ia.s:605: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
/tmp/ccPqf5ia.s:855: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
...
/tmp/ccPqf5ia.s:2206: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
/tmp/ccPqf5ia.s:2530: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
make[2]: *** [confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/build.make:76: confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/threadpool-pthreads.c.o] Error 1
make[2]: Leaving directory '/home/pi/projects/pytorch/build'
make[1]: *** [CMakeFiles/Makefile2:517: confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/all] Error 2
make[1]: Leaving directory '/home/pi/projects/pytorch/build'
make: *** [Makefile:141: all] Error 2
pi@raspbari3:~/projects/pytorch/build $ "><pre class="notranslate"><code class="notranslate">/home/pi/projects/pytorch/build/confu-srcs/pthreadpool/include/pthreadpool.h:223:2: warning: ‘pthreadpool_function_4d_tiled_t’ is deprecated [-Wdeprecated-declarations]
pthreadpool_function_4d_tiled_t function,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccPqf5ia.s: Assembler messages:
/tmp/ccPqf5ia.s:605: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
/tmp/ccPqf5ia.s:855: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
...
/tmp/ccPqf5ia.s:2206: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
/tmp/ccPqf5ia.s:2530: Error: immediate expression requires a # prefix -- `orr r3,0x1000000'
make[2]: *** [confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/build.make:76: confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/src/threadpool-pthreads.c.o] Error 1
make[2]: Leaving directory '/home/pi/projects/pytorch/build'
make[1]: *** [CMakeFiles/Makefile2:517: confu-deps/pthreadpool/CMakeFiles/pthreadpool.dir/all] Error 2
make[1]: Leaving directory '/home/pi/projects/pytorch/build'
make: *** [Makefile:141: all] Error 2
pi@raspbari3:~/projects/pytorch/build $
</code></pre></div>
<p dir="auto">The platform summary is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
$ uname -a
Linux raspbari3 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux
$"><pre class="notranslate"><code class="notranslate">$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
$ uname -a
Linux raspbari3 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux
$
</code></pre></div>
<p dir="auto">I understand that trying to install <strong>pytorch</strong> on RPi0W detracts but I'm willing to be an able-bodied tester since I have quite a few Raspberry Pi Zero W boards where I need <strong>pytorch</strong> to work. The RPi0 boards have many other packages (for vision/image/ML) working and I was hoping to install <strong>pytorch</strong> too. Any help will be sincerely appreciated.</p>
<p dir="auto">Kind regards.</p> | <h2 dir="auto">Issue description</h2>
<p dir="auto">There's a recent change in jit scripting path for nn.interpolate operator. After aten::__interpolate operator is removed and the scriptable nn.interpolate module has become scriptable as part of this PR: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="578241668" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/34514" data-hovercard-type="pull_request" data-hovercard-url="/pytorch/pytorch/pull/34514/hovercard" href="https://github.com/pytorch/pytorch/pull/34514">#34514</a>, the graph new graph is exported using hundreds of extra nodes.<br>
This means that the the jit graph for interpolate op is now scripting the whole module and creates the inflated graph below for a single op:<br>
torch.nn.functional.interpolate(x, mode="trilinear", size=(4, 4, 6))<br>
<a href="https://github.com/pytorch/pytorch/files/4330624/graph.txt">graph.txt</a></p>
<p dir="auto">Currently, this change broke onnx export of scripted nn.interpolate module, and the following tests are disable:<br>
</p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/pytorch/pytorch/blob/8e8a37d7464638efef2bc0c372712b57e4b4f678/test/onnx/test_pytorch_onnx_onnxruntime.py#L1294">pytorch/test/onnx/test_pytorch_onnx_onnxruntime.py</a>
</p>
<p class="mb-0 color-fg-muted">
Line 1294
in
<a data-pjax="true" class="commit-tease-sha" href="/pytorch/pytorch/commit/8e8a37d7464638efef2bc0c372712b57e4b4f678">8e8a37d</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L1294" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1294"></td>
<td id="LC1294" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">@<span class="pl-s1">unittest</span>.<span class="pl-en">skipIf</span>(<span class="pl-c1">True</span>, <span class="pl-s">"Interpolate script NYI"</span>)</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">As part of this change, onnx export of torchvision Keypoint RCNN module is also broken.<br>
</p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/pytorch/pytorch/blob/8e8a37d7464638efef2bc0c372712b57e4b4f678/test/onnx/test_pytorch_onnx_onnxruntime.py#L349">pytorch/test/onnx/test_pytorch_onnx_onnxruntime.py</a>
</p>
<p class="mb-0 color-fg-muted">
Line 349
in
<a data-pjax="true" class="commit-tease-sha" href="/pytorch/pytorch/commit/8e8a37d7464638efef2bc0c372712b57e4b4f678">8e8a37d</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L349" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="349"></td>
<td id="LC349" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">test_mask_rcnn</span>(<span class="pl-s1">self</span>): </td>
</tr>
</tbody></table>
</div>
</div>
<br>
<a href="https://l.facebook.com/l.php?u=https%3A%2F%2Fcircleci.com%2Fapi%2Fv1.1%2Fproject%2Fgithub%2Fpytorch%2Fpytorch%2F4791771%2Foutput%2F105%2F0%3Ffile%3Dtrue%26allocation-id%3D5e6ab6cf58b6cb1d3d495d0d-0-build%2F61B5E26C%26fbclid%3DIwAR0kYcxY742VnXh6lpnH4FckYIJAhE03bp8vcRWdS-Yh4PsylwBZBFA5Dfk&h=AT0tPobGkR1UpwhdxgJ3JEH7udDQRrgMW0GNWD7Smsq4_fqZD8DJnCqLT06ppG-kwzXrRA6k00KS40CiaaAjFtxblyXg8JwjmVqv7F0XPTD_hvQhUnSGj8lv5Zt5JDBfjDWZtTtacm8" rel="nofollow">https://l.facebook.com/l.php?u=https%3A%2F%2Fcircleci.com%2Fapi%2Fv1.1%2Fproject%2Fgithub%2Fpytorch%2Fpytorch%2F4791771%2Foutput%2F105%2F0%3Ffile%3Dtrue%26allocation-id%3D5e6ab6cf58b6cb1d3d495d0d-0-build%2F61B5E26C%26fbclid%3DIwAR0kYcxY742VnXh6lpnH4FckYIJAhE03bp8vcRWdS-Yh4PsylwBZBFA5Dfk&h=AT0tPobGkR1UpwhdxgJ3JEH7udDQRrgMW0GNWD7Smsq4_fqZD8DJnCqLT06ppG-kwzXrRA6k00KS40CiaaAjFtxblyXg8JwjmVqv7F0XPTD_hvQhUnSGj8lv5Zt5JDBfjDWZtTtacm8</a><p></p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/houseroad/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/houseroad">@houseroad</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/spandantiwari/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/spandantiwari">@spandantiwari</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lara-hdr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lara-hdr">@lara-hdr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/BowenBao/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/BowenBao">@BowenBao</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/neginraoof/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/neginraoof">@neginraoof</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eellison/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eellison">@eellison</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/suo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/suo">@suo</a></p> | 0 |
<p dir="auto">I need to limit CPU usage of tensorflow on Windows by setting inter_op_parallelism_threads = 1 , ( intra_op_parallelism_threads = 1 also for CPU)</p>
<p dir="auto">When I run a model on CPU, inter_op_parallelism_threads = 1 works perfectly, and only one logical core is used.</p>
<p dir="auto">But when I run a model on GPU, inter_op_parallelism_threads =1 doesn't work, tensorflow still uses all the available logical cores.</p> | <p dir="auto">We are using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="with sv.managed_session(
server.target,
config=tf.ConfigProto(log_device_placement=True,
inter_op_parallelism_threads=1,
intra_op_parallelism_threads=1),
) as sess:"><pre lang=".python" class="notranslate"><code class="notranslate">with sv.managed_session(
server.target,
config=tf.ConfigProto(log_device_placement=True,
inter_op_parallelism_threads=1,
intra_op_parallelism_threads=1),
) as sess:
</code></pre></div>
<p dir="auto">but TensorFlow still launches a number of threads proportional to the number of cores on each process. I counted +50 threads used by each process on my 24 vcore machine.</p>
<p dir="auto">What can we do to limit the number of threads in a managed session.</p>
<p dir="auto">EDIT: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/yaroslavvb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yaroslavvb">@yaroslavvb</a> identified the problem. See the end of the thread about Session vs Server options.</p> | 1 |
<p dir="auto">It would be useful to us and I'm pretty sure to other people to be able to call gemm in C.<br>
There is the file numpy/core/src/multiarray/cblasfuncs.c that contain this function:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="static void
gemm(int typenum, enum CBLAS_ORDER order,
enum CBLAS_TRANSPOSE transA, enum CBLAS_TRANSPOSE transB,
int m, int n, int k,
PyArrayObject *A, int lda, PyArrayObject *B, int ldb, PyArrayObject *R)"><pre class="notranslate"><code class="notranslate">static void
gemm(int typenum, enum CBLAS_ORDER order,
enum CBLAS_TRANSPOSE transA, enum CBLAS_TRANSPOSE transB,
int m, int n, int k,
PyArrayObject *A, int lda, PyArrayObject *B, int ldb, PyArrayObject *R)
</code></pre></div>
<p dir="auto">Giving access to it would solve this, this function is currently private and do not do error checking. The function:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="NPY_NO_EXPORT PyObject *
cblas_matrixproduct(int typenum, PyArrayObject *ap1, PyArrayObject *ap2,
PyArrayObject *out)"><pre class="notranslate"><code class="notranslate">NPY_NO_EXPORT PyObject *
cblas_matrixproduct(int typenum, PyArrayObject *ap1, PyArrayObject *ap2,
PyArrayObject *out)
</code></pre></div>
<p dir="auto">In the same file does the error checking, but do not allow the alpha and beta parameter.</p>
<p dir="auto">Before going further and plan how to implement it. Would a PR that add a public function PyArray_Gemm that take the 3 ndarray + alpha + beta be accepted?</p> | <p dir="auto">I was wondering if it's possible for the relevant Numpy DLLs (e.g. lapack_lite or _umath_linalg) to export the CBLAS functions, so that other software can call into them using e.g. ctypes. Under Linux they are exported by default, but not under Windows (AFAIK you have to explicitly export symbols on Windows, by default "global" symbols in a shared library are private to the library).</p>
<p dir="auto">Or perhaps I'm missing another way of accessing those functions at runtime?</p> | 1 |
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => 4.1.1</li>
<li>Operating System / Platform => Windows 64 Bit / C++ & Python</li>
<li>Compiler => Visual Studio 2017, Python 3.7.6</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I just updated OpenCV 4.2.0 and found a big problem.<br>
If I open the lenna BMP image with IMREAD_GRAYSCALE flag, the image is little bit dark. (the mean value was 110)<br>
I felt something weird because I knew the mean value of lenna gray image is 124.<br>
So I tried to open the lenna image as a color image and convert it to a grayscale image using cvtColor(), then the mean value was 124.<br>
So there must be something wrong on the color conversion code in imread().</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Mat src1 = imread("lenna.bmp", IMREAD_GRAYSCALE);<br>
Mat src2 = imread("lenna.bmp", IMREAD_COLOR);<br>
cvtColor(src2, src2, COLOR_BGR2GRAY);</p>
<p dir="auto">cout << mean(src1)[0] << endl; // 110.207<br>
cout << mean(src2)[0] << endl; // 124.049</p>
<h5 dir="auto">My opinion</h5>
<p dir="auto">I checked the recent versions, and found that OpenCV 4.1.0 was ok.<br>
So I searched commits and found it:<br>
<a class="commit-link" href="https://github.com/opencv/opencv/commit/058367f34c60d6a843579adce84895f4bc5d31dd#diff-c868f69925dd124c54190546d4843841"><tt>058367f</tt>#diff-c868f69925dd124c54190546d4843841</a></p>
<p dir="auto">In the updated code, I think 68th line should be changed like this:</p>
<p dir="auto">(-) if (_swap_rb) std::swap(cRGB0, cRGB2);<br>
(+) if (!_swap_rb) std::swap(cRGB0, cRGB2);</p>
<p dir="auto">Please check the code.</p> | <p dir="auto"><a class="commit-link" href="https://github.com/opencv/opencv/commit/058367f34c60d6a843579adce84895f4bc5d31dd#diff-c868f69925dd124c54190546d4843841"><tt>058367f</tt>#diff-c868f69925dd124c54190546d4843841</a> break BGR color conversion utilities in opencv/modules/imgcodecs/src/utils.cpp.<br>
Before this commit when swap channels is set to 0 we have a following formula:<br>
rgba[0]*cB + rgba[1]*cG + rgba[2]*cR</p>
<p dir="auto">As <code class="notranslate">rgba</code>, in this case, is really BGRA data it works fine.</p>
<p dir="auto">After this change:<br>
rgba[0]*cRGB0 + rgba[1]*cG + rgba[2]*cRGB2<br>
where<br>
cRGB0 = cR<br>
cRGB0 = cB</p>
<p dir="auto">It is used by ../modules/imgcodecs/src/grfmt_tiff.cpp which reads RBG data, but uses icvCvt_BGRA2Gray_8u_C4C1R for conversion but with channel swapped.</p>
<p dir="auto">relates <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="453605866" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/14760" data-hovercard-type="pull_request" data-hovercard-url="/opencv/opencv/pull/14760/hovercard" href="https://github.com/opencv/opencv/pull/14760">#14760</a></p> | 1 |
<p dir="auto">Hi,<br>
I design a network which composes of shared layers, I write code using functional API. However, there always be errors.<br>
I paste my network structure graph , code , and error information below, hope to provide a clue.<br>
Thanks!</p>
<p dir="auto">Network Structure:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/ylqfp/attachments/bb396650622b37b2a311d29864795aec67301042/cnn2_2_lstm.jpg"><img src="https://raw.githubusercontent.com/ylqfp/attachments/bb396650622b37b2a311d29864795aec67301042/cnn2_2_lstm.jpg" alt="network structure jpeg" style="max-width: 100%;"></a><br>
Share layers:</p>
<ol dir="auto">
<li>Embedding is shared among 3 input.(blue color). However, input_length is different for input1/input2 and input3. The input_length for input1/input2 is LSTM_MAXLEN, 1000, for input3 is QUERY_MAXLEN, 5, eg. max 5 words for a query.</li>
<li>CNN feature learning layer is shared between input1 and input2. (green color)</li>
</ol> | <p dir="auto">I'm trying to create a neural network "within" a neural network, basically I branch off from an intermediate layer, use that as an output to train another neural network. I want to train both networks together. I can't seem to do it, I run into the following error:</p>
<p dir="auto"><em>UserWarning: Model inputs must come from a Keras Input layer, they cannot be the output of a previous non-Input layer</em></p>
<p dir="auto">Sample code below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# 1st NN: Simple convolutional autoencoder
input_img = Input(shape=(1, 80, 80), name="input_layer")
intermediate = Convolution2D(32, 3, 3, subsample=(2, 2))(input_img)
decoded = Deconvolution2D(1, 3, 3, subsample=(2, 2))(intermediate)
#2nd NN: Uses output from encoding part to do supervised learning on FC layers
fc_flatten = Flatten()(intermediate)
y = Dense(64)(fc_flatten)
fc_output = Dense(1)(y)
model = Model(input=[input_img, fc_flatten], output=[decoded, fc_output])"><pre class="notranslate"><code class="notranslate"># 1st NN: Simple convolutional autoencoder
input_img = Input(shape=(1, 80, 80), name="input_layer")
intermediate = Convolution2D(32, 3, 3, subsample=(2, 2))(input_img)
decoded = Deconvolution2D(1, 3, 3, subsample=(2, 2))(intermediate)
#2nd NN: Uses output from encoding part to do supervised learning on FC layers
fc_flatten = Flatten()(intermediate)
y = Dense(64)(fc_flatten)
fc_output = Dense(1)(y)
model = Model(input=[input_img, fc_flatten], output=[decoded, fc_output])
</code></pre></div>
<p dir="auto">I don't understand. I'm using almost the same architecture as the "Multi-input and multi-output models" example on the Keras Functional API, with the exception that I don't have an auxillary input.</p> | 0 |
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li>**Electron Version:<em>10.1.2</em>
<ul dir="auto">
<li>
</li>
</ul>
</li>
<li>**Operating System:<em>Windows 10 Enterprise</em>
<ul dir="auto">
<li>
</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>
</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I am trying to stop the second instance under special circumstances (which is not being over the registered protocol/scheme).</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">I identify the second instance and call app.quit() but the application window still appears. I tried app.exit() instead with no luck.<br>
The application continues to open up (new windows). I also notice no calls made to these events after calling quit() or exit():</p>
<p dir="auto">app.on('window-all-closed', () => {<br>
console.log('window-all-closed ', process.platform);</p>
<p dir="auto">});</p>
<p dir="auto">app.on('before-quit', () => {<br>
console.log('before-quit');<br>
mainWindow.close();<br>
});</p>
<p dir="auto">app.on('activate', () => {<br>
console.log('activate is called');<br>
if (mainWindow === null) {<br>
mainWindow = windowLauncher.createWindow();<br>
}<br>
});</p>
<p dir="auto">as the console.log does not write anything in the output.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">call app.requestSingleInstanceLock() and try to quit the app if no lock could be gained from the call.</p>
<h3 dir="auto">Screenshots</h3>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">here is my code:</p>
<p dir="auto"><code class="notranslate">const gotTheLock: boolean = app.requestSingleInstanceLock(); if (!gotTheLock) { console.log('second instance identified, closing the app'); app.quit(); console.log('quit() was called'); }</code></p> | <h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong> v11.2.0</li>
<li><strong>Operating System:</strong> macOS Big Sur 11.1</li>
<li><strong>Last Known Working Electron version:</strong></li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Electron renderer process not to crash.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Electron renderer process crashes.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto"><strong>Make sure to use the ARM version of node!</strong><br>
Download GAM file: <a href="http://mirror.ifarchive.org/if-archive/games/tads/worlds.zip" rel="nofollow">http://mirror.ifarchive.org/if-archive/games/tads/worlds.zip</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone https://github.com/Durafen/lectrote.git
cd lectrote
git submodule init
git submodule update
npm install
.\node_modules\.bin\electron ."><pre class="notranslate"><code class="notranslate">git clone https://github.com/Durafen/lectrote.git
cd lectrote
git submodule init
git submodule update
npm install
.\node_modules\.bin\electron .
</code></pre></div>
<p dir="auto">And then extract the worlds.gam file to the same directory as lectrote and then load it from the interface.</p>
<h3 dir="auto">Screenshots</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7021881/104929729-ee2b6380-59ac-11eb-8abb-7298f4628e0f.png"><img src="https://user-images.githubusercontent.com/7021881/104929729-ee2b6380-59ac-11eb-8abb-7298f4628e0f.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">This is the output from the run:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
[43191:0x7100000000] 44 ms: Scavenge 3.0 (4.3) -> 2.9 (4.8) MB, 0.5 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[43191:0x7100000000] 52 ms: Scavenge 4.1 (5.5) -> 3.7 (8.0) MB, 0.4 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[43191:0x7100000000] 96 ms: Scavenge 4.9 (8.5) -> 4.5 (9.3) MB, 0.4 / 0.0 ms (average mu = 1.000, current mu = 1.000) external memory pressure
<--- JS stacktrace --->
[43185:0118/164751.510962:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. 93:F0:C7:06:C4:41:42:D4:65:FB:D7:38:76:16:D2:F5
[43185:0118/164751.511256:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511282:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511299:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511313:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. C2:8E:5D:7C:46:DE:36:D8:DC:4A:AD:2F:D1:39:CC:EB
[43185:0118/164751.511330:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511345:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511358:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511372:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. A2:84:80:A8:A1:72:CE:4B:6D:0E:A6:B5:7A:F1:64:29
[43185:0118/164751.511386:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511398:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511414:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511425:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. CB:2A:78:10:69:E1:B9:C3:33:32:F8:EA:E8:4C:60:2F
[43185:0118/164751.511441:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511454:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511472:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[43185:0118/164751.519830:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519861:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519875:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519887:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared @image```"><pre lang="<---" class="notranslate"><code class="notranslate">
[43191:0x7100000000] 44 ms: Scavenge 3.0 (4.3) -> 2.9 (4.8) MB, 0.5 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[43191:0x7100000000] 52 ms: Scavenge 4.1 (5.5) -> 3.7 (8.0) MB, 0.4 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[43191:0x7100000000] 96 ms: Scavenge 4.9 (8.5) -> 4.5 (9.3) MB, 0.4 / 0.0 ms (average mu = 1.000, current mu = 1.000) external memory pressure
<--- JS stacktrace --->
[43185:0118/164751.510962:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. 93:F0:C7:06:C4:41:42:D4:65:FB:D7:38:76:16:D2:F5
[43185:0118/164751.511256:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511282:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511299:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511313:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. C2:8E:5D:7C:46:DE:36:D8:DC:4A:AD:2F:D1:39:CC:EB
[43185:0118/164751.511330:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511345:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511358:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511372:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. A2:84:80:A8:A1:72:CE:4B:6D:0E:A6:B5:7A:F1:64:29
[43185:0118/164751.511386:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511398:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511414:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[43185:0118/164751.511425:ERROR:shared_image_manager.cc(143)] SharedImageManager::ProduceGLTexture: Trying to produce a representation from a non-existent mailbox. CB:2A:78:10:69:E1:B9:C3:33:32:F8:EA:E8:4C:60:2F
[43185:0118/164751.511441:ERROR:gles2_cmd_decoder.cc(19029)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoCreateAndTexStorage2DSharedImageINTERNAL: invalid mailbox name
[43185:0118/164751.511454:ERROR:gles2_cmd_decoder.cc(19050)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoBeginSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.511472:ERROR:gles2_cmd_decoder.cc(13915)] [.DisplayCompositor]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[43185:0118/164751.519830:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519861:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519875:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared image
[43185:0118/164751.519887:ERROR:gles2_cmd_decoder.cc(19079)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : DoEndSharedImageAccessCHROMIUM: bound texture is not a shared @image```
</code></pre></div> | 0 |
<p dir="auto">Perhaps it's using 32bit ints as the indices instead of u64?</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.ensemble import ExtraTreesClassifier
import numpy as np
np.random.seed(32)
clf = ExtraTreesClassifier(n_estimators=1000,
max_depth=None,
max_features=None,
min_samples_split=5,
min_samples_leaf=5)
print "Making X"
X = np.random.randn(25000,100000)
print "X size", np.size(X)
print "Making y"
y = np.random.randint(10, size=(25000,1))
print "Fitting..."
clf.fit(X,y)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">ensemble</span> <span class="pl-k">import</span> <span class="pl-v">ExtraTreesClassifier</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">seed</span>(<span class="pl-c1">32</span>)
<span class="pl-s1">clf</span> <span class="pl-c1">=</span> <span class="pl-v">ExtraTreesClassifier</span>(<span class="pl-s1">n_estimators</span><span class="pl-c1">=</span><span class="pl-c1">1000</span>,
<span class="pl-s1">max_depth</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
<span class="pl-s1">max_features</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
<span class="pl-s1">min_samples_split</span><span class="pl-c1">=</span><span class="pl-c1">5</span>,
<span class="pl-s1">min_samples_leaf</span><span class="pl-c1">=</span><span class="pl-c1">5</span>)
<span class="pl-k">print</span> <span class="pl-s">"Making X"</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">25000</span>,<span class="pl-c1">100000</span>)
<span class="pl-k">print</span> <span class="pl-s">"X size"</span>, <span class="pl-s1">np</span>.<span class="pl-en">size</span>(<span class="pl-v">X</span>)
<span class="pl-k">print</span> <span class="pl-s">"Making y"</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">10</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">25000</span>,<span class="pl-c1">1</span>))
<span class="pl-k">print</span> <span class="pl-s">"Fitting..."</span>
<span class="pl-s1">clf</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>,<span class="pl-s1">y</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[erg@pliny src]$ [master*] gdb python2
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.
(gdb) run crash.py
Starting program: /usr/bin/python2 crash.py
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Making X
X size 2500000000
Making y
Fitting...
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
(gdb) bt
#0 0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#1 0x00007fffe9680f2e in __pyx_f_7sklearn_4tree_5_tree_4Tree_recursive_partition ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#2 0x00007fffe9675008 in __pyx_f_7sklearn_4tree_5_tree_4Tree_build ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#3 0x00007fffe9671af0 in __pyx_pw_7sklearn_4tree_5_tree_4Tree_11build ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#4 0x00007ffff7afd192 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#6 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#7 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#8 0x00007ffff7a8f63f in function_call () from /usr/lib/libpython2.7.so.1.0
#9 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7af9cce in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7abe5b2 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7abe24c in type_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7afda83 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7abe962 in slot_tp_call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#31 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#32 0x00007ffff7afefb2 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#33 0x00007ffff7b17eea in run_mod () from /usr/lib/libpython2.7.so.1.0
#34 0x00007ffff7b18ce2 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#35 0x00007ffff7b196fb in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#36 0x00007ffff7b2a9f2 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#37 0x00007ffff747aa15 in __libc_start_main () from /usr/lib/libc.so.6
#38 0x0000000000400741 in _start ()"><pre class="notranslate"><code class="notranslate">[erg@pliny src]$ [master*] gdb python2
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.
(gdb) run crash.py
Starting program: /usr/bin/python2 crash.py
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Making X
X size 2500000000
Making y
Fitting...
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
(gdb) bt
#0 0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#1 0x00007fffe9680f2e in __pyx_f_7sklearn_4tree_5_tree_4Tree_recursive_partition ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#2 0x00007fffe9675008 in __pyx_f_7sklearn_4tree_5_tree_4Tree_build ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#3 0x00007fffe9671af0 in __pyx_pw_7sklearn_4tree_5_tree_4Tree_11build ()
from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#4 0x00007ffff7afd192 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#6 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#7 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#8 0x00007ffff7a8f63f in function_call () from /usr/lib/libpython2.7.so.1.0
#9 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7af9cce in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7abe5b2 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7abe24c in type_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7afda83 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7abe962 in slot_tp_call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#31 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#32 0x00007ffff7afefb2 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#33 0x00007ffff7b17eea in run_mod () from /usr/lib/libpython2.7.so.1.0
#34 0x00007ffff7b18ce2 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#35 0x00007ffff7b196fb in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#36 0x00007ffff7b2a9f2 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#37 0x00007ffff747aa15 in __libc_start_main () from /usr/lib/libc.so.6
#38 0x0000000000400741 in _start ()
</code></pre></div> | <p dir="auto">I notice that the current <a href="http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.SelectFromModel.html" rel="nofollow">SelectKBest</a> doesn't allow a user to select the <code class="notranslate">k</code> best features from a model. Are there any thoughts about adding a <code class="notranslate">k</code>-best feature selection using a model?</p>
<p dir="auto">Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149033549" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/6673" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/6673/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/6673">#6673</a>.</p> | 0 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://github.com/celery/celery/discussions">discussions forum</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="https://docs.celeryq.dev/en/master/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>:</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#celery report
software -> celery:3.1.26.post2 (Cipater) kombu:3.0.37 py:3.6.4
billiard:3.3.0.23 py-amqp:1.4.9
platform -> system:Linux arch:64bit, ELF imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled"><pre class="notranslate"><code class="notranslate">#celery report
software -> celery:3.1.26.post2 (Cipater) kombu:3.0.37 py:3.6.4
billiard:3.3.0.23 py-amqp:1.4.9
platform -> system:Linux arch:64bit, ELF imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled
</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 3.6.4</li>
<li><strong>Minimal Celery Version</strong>: 3.1.26.post2</li>
<li><strong>Minimal Kombu Version</strong>: 3.0.37</li>
<li><strong>Minimal Broker Version</strong>: redis5</li>
<li><strong>Minimal Result Backend Version</strong>:</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: centos7</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">version info</h3>
<p dir="auto">celery 3.1.26.post2<br>
celery-once 3.0.1<br>
django-celery 3.3.0</p>
<h3 dir="auto">Python Packages</h3>
<details>
Output:
```shelll
#python3 -m pip list
Package Version
---------------------------------- ------------
aenum 2.2.3
amqp 1.4.9
anyjson 0.3.3
APScheduler 3.5.3
asn1crypto 0.24.0
Babel 2.7.0
backcall 0.2.0
backports.lzma 0.0.14
bcrypt 3.1.7
billiard 3.3.0.23
bitarray 1.5.3
cassandra-driver 3.19.0
celery 3.1.26.post2
celery-once 3.0.1
certifi 2021.5.30
cffi 1.14.6
chardet 3.0.4
charset-normalizer 2.0.3
clickhouse-driver 0.2.1
coreapi 2.3.3
coreschema 0.0.4
crcmod 1.7
cryptography 3.4.7
cycler 0.10.0
dateparser 1.0.0
decorator 5.0.9
Django 2.0.1
django-cas-ng 3.6.0
django-celery 3.3.0
django-cors-headers 2.1.0
django-extensions 3.1.0
django-redis 4.10.0
django-werkzeug-debugger-runserver 0.3.1
djangorestframework 3.7.7
djangorestframework-jwt 1.11.0
docopt 0.6.2
drf-yasg 1.16.0
elasticsearch 7.13.4
enum34 1.1.6
et-xmlfile 1.1.0
flower 0.9.3
future 0.17.1
gevent 1.3.4
greenlet 1.1.0
gremlinpython 3.4.4
gunicorn 19.8.1
happybase 1.2.0
idna 3.2
importlib-metadata 4.6.1
impyla 0.16.2
inflection 0.5.1
ipython 7.16.1
ipython-genutils 0.2.0
isodate 0.6.0
itypes 1.2.0
jdcal 1.4
jedi 0.17.2
Jinja2 3.0.1
jmespath 0.10.0
joblib 0.16.0
kiwisolver 1.2.0
kombu 3.0.37
ldap3 2.4.1
lxml 4.2.5
MarkupSafe 2.0.1
matplotlib 3.2.1
mybatis-mapper2sql 0.1.8
Naked 0.1.31
numpy 1.19.5
odps 3.5.1
openpyxl 3.0.7
oss2 2.5.0
pandas 1.1.5
paramiko 2.7.2
parso 0.7.1
pexpect 4.8.0
phoenixdb 0.7
pickleshare 0.7.5
Pillow 7.2.0
pip 20.2.3
ply 3.11
prettytable 0.7.2
prompt-toolkit 3.0.19
protobuf 3.17.3
psutil 5.8.0
ptyprocess 0.7.0
pyasn1 0.4.8
pycparser 2.20
pycryptodome 3.10.4
Pygments 2.9.0
PyJWT 1.6.4
pymongo 3.7.2
PyMySQL 0.9.2
PyNaCl 1.4.0
pyodps 0.10.7
pyOpenSSL 19.1.0
pyparsing 2.4.7
pypinyin 0.42.0
python-cas 1.4.0
python-dateutil 2.8.2
python-docx 0.8.6
pytz 2021.1
PyYAML 5.4.1
redis 2.10.6
regex 2021.7.6
requests 2.26.0
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
scikit-learn 0.23.1
scipy 1.5.1
setuptools 28.8.0
shellescape 3.8.1
simplejson 3.15.0
six 1.16.0
sklearn 0.0
SQLAlchemy 1.4.20
sqlparse 0.2.4
sshtunnel 0.4.0
tablestore 5.1.0
threadpoolctl 2.1.0
thrift 0.13.0
thriftpy2 0.4.5
tornado 4.5.3
traitlets 4.3.3
typing-extensions 3.10.0.0
tzlocal 2.1
uritemplate 4.1.1
urllib3 1.26.6
wcwidth 0.2.5
Werkzeug 1.0.1
xlrd 2.0.1
XlsxWriter 1.2.7
xlwt 1.3.0
xpinyin 0.7.6
zipp 3.5.0
```
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
Redis5.0
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
### my celery task like below
```python
from celery import task
</p><p dir="auto">def execuet_job():<br>
result = execute_celery.apply_async(params)</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/task/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/task">@task</a>(base=QueueOnce, once={'graceful': True})<br>
def execute_celery(params):<br>
do_some_job()</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
</p>
start celery with the following command
```shell
celery multi start proj -A settings worker -l info --statedb=/data/celery/working1.state --logfile=/data/celery/worker.log --pidfile=/data/celery/worker1.pid -n worker1.%h -Q worker1_queue"><pre class="notranslate"><code class="notranslate">
</p>
start celery with the following command
```shell
celery multi start proj -A settings worker -l info --statedb=/data/celery/working1.state --logfile=/data/celery/worker.log --pidfile=/data/celery/worker1.pid -n worker1.%h -Q worker1_queue
</code></pre></div>
</details>
### my celery config
```python
import os
from celery import Celery
<p dir="auto">app = Celery('src')</p>
<p dir="auto">app.config_from_object('django.conf:settings')</p>
<p dir="auto">app.conf.ONCE = {<br>
'backend': 'celery_once.backends.Redis',<br>
'settings': {<br>
'url': 'redis://:%s@%s:%s/3' % (<br>
redis_password, redis_address, redis_port),<br>
'default_timeout': 172800<br>
}<br>
}</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="### my django project settings like below
```python
import os
import datetime
from libs import util
import djcelery
from kombu import Exchange, Queue
import sys
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://' + redis_conf.redis_address + ':' + redis_conf.redis_port,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"CONNECTION_POOL_KWARGS": {"max_connections": 100},
"PASSWORD": redis_conf.redis_password,
},
},
}
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
),
}
JWT_AUTH = {
'JWT_RESPONSE_PAYLOAD_HANDLER':
'rest_framework_jwt.utils.jwt_response_payload_handler',
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=3000000),
}
djcelery.setup_loader()
CELERYD_FORCE_EXECV = True
CELERYD_CONCURRENCY = 4
CELERY_ACKS_LATE = False
CELERYD_MAX_TASKS_PER_CHILD = 200
CELERYD_TASK_TIME_LIMIT = 172800
BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 31536000}
CELERY_DISABLE_RATE_LIMITS = True
CELERY_IMPORTS = (
'proj.tasks',
'proj.archiver'
)
CELERY_TIMEZONE = 'Asia/Shanghai'
BROKER_BACKEND = 'redis'
BROKER_URL = 'redis://:%s@%s:%s/1' % (
redis_conf.redis_password, redis_conf.redis_address, redis_conf.redis_port)
CELERY_RESULT_BACKEND = 'redis://:%s@%s:%s/2' % (
redis_conf.redis_password, redis_conf.redis_address, redis_conf.redis_port)
CELERY_QUEUES = (
Queue("default", Exchange("default"), routing_key="default"),
Queue("worker1_queue", Exchange("worker1_queue"), routing_key="worker1_router"),
Queue("worker2_queue", Exchange("worker2_queue"), routing_key="worker2_router"),
Queue("worker3_queue", Exchange("worker3_queue"), routing_key="worker3_router"),
Queue("worker4_queue", Exchange("worker4_queue"), routing_key="worker4_router"),
Queue("worker5_queue", Exchange("worker5_queue"), routing_key="worker5_router")
)
CELERY_ROUTES = {
'proj.tasks.mytask_execute_celery1': {"queue": "worker1_queue", "routing_key": "worker1_router"},
'proj.tasks.mytask_execute_celery2': {"queue": "worker2_queue", "routing_key": "worker2_router"},
'proj.tasks.mytask_execute_celery3': {"queue": "worker3_queue", "routing_key": "worker3_router"},
'proj.tasks.mytask_execute_celery4': {"queue": "worker4_queue", "routing_key": "worker4_router"},
'proj.tasks.work_execute_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"},
'proj.archiver.newwork_execute_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"},
'proj.tasks.binlog_analyse_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"}
}
"><pre class="notranslate"><code class="notranslate">### my django project settings like below
```python
import os
import datetime
from libs import util
import djcelery
from kombu import Exchange, Queue
import sys
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://' + redis_conf.redis_address + ':' + redis_conf.redis_port,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"CONNECTION_POOL_KWARGS": {"max_connections": 100},
"PASSWORD": redis_conf.redis_password,
},
},
}
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
),
}
JWT_AUTH = {
'JWT_RESPONSE_PAYLOAD_HANDLER':
'rest_framework_jwt.utils.jwt_response_payload_handler',
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=3000000),
}
djcelery.setup_loader()
CELERYD_FORCE_EXECV = True
CELERYD_CONCURRENCY = 4
CELERY_ACKS_LATE = False
CELERYD_MAX_TASKS_PER_CHILD = 200
CELERYD_TASK_TIME_LIMIT = 172800
BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 31536000}
CELERY_DISABLE_RATE_LIMITS = True
CELERY_IMPORTS = (
'proj.tasks',
'proj.archiver'
)
CELERY_TIMEZONE = 'Asia/Shanghai'
BROKER_BACKEND = 'redis'
BROKER_URL = 'redis://:%s@%s:%s/1' % (
redis_conf.redis_password, redis_conf.redis_address, redis_conf.redis_port)
CELERY_RESULT_BACKEND = 'redis://:%s@%s:%s/2' % (
redis_conf.redis_password, redis_conf.redis_address, redis_conf.redis_port)
CELERY_QUEUES = (
Queue("default", Exchange("default"), routing_key="default"),
Queue("worker1_queue", Exchange("worker1_queue"), routing_key="worker1_router"),
Queue("worker2_queue", Exchange("worker2_queue"), routing_key="worker2_router"),
Queue("worker3_queue", Exchange("worker3_queue"), routing_key="worker3_router"),
Queue("worker4_queue", Exchange("worker4_queue"), routing_key="worker4_router"),
Queue("worker5_queue", Exchange("worker5_queue"), routing_key="worker5_router")
)
CELERY_ROUTES = {
'proj.tasks.mytask_execute_celery1': {"queue": "worker1_queue", "routing_key": "worker1_router"},
'proj.tasks.mytask_execute_celery2': {"queue": "worker2_queue", "routing_key": "worker2_router"},
'proj.tasks.mytask_execute_celery3': {"queue": "worker3_queue", "routing_key": "worker3_router"},
'proj.tasks.mytask_execute_celery4': {"queue": "worker4_queue", "routing_key": "worker4_router"},
'proj.tasks.work_execute_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"},
'proj.archiver.newwork_execute_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"},
'proj.tasks.binlog_analyse_celery': {"queue": "worker5_queue", "routing_key": "worker5_router"}
}
</code></pre></div>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">except work execute succes</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">I submit task to celery,I saw the celery log,task was received</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" Received task: tasks.execute_celery[b664cb23-5c80-46c7-9705-28295cd4431f]"><pre class="notranslate"> Received task: tasks.execute_celery[b664cb23-5c80-46c7-9705-28295cd4431f]</pre></div>
<p dir="auto">however,the task was not execute,with celery state <code class="notranslate">RECEIVED</code>, what's the problem with celery?</p> | <p dir="auto">hacked in <code class="notranslate">kombu/asynchronous/hub.py:Hub.close</code> to edit debug log, related code:</p>
<p dir="auto"><a href="https://github.com/celery/kombu/blob/master/kombu/asynchronous/hub.py#L247-L263">https://github.com/celery/kombu/blob/master/kombu/asynchronous/hub.py#L247-L263</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" def close(self, *args):
[self._unregister(fd) for fd in self.readers]
self.readers.clear()
[self._unregister(fd) for fd in self.writers]
self.writers.clear()
self.consolidate.clear()
self._close_poller()
for callback in self.on_close:
callback(self)
# Complete remaining todo before Hub close
# Eg: Acknowledge message
# To avoid infinite loop where one of the callables adds items
# to self._ready (via call_soon or otherwise).
# we create new list with current self._ready
import inspect
print(inspect.stack())
for item in list(self._ready):
item()"><pre class="notranslate"><code class="notranslate"> def close(self, *args):
[self._unregister(fd) for fd in self.readers]
self.readers.clear()
[self._unregister(fd) for fd in self.writers]
self.writers.clear()
self.consolidate.clear()
self._close_poller()
for callback in self.on_close:
callback(self)
# Complete remaining todo before Hub close
# Eg: Acknowledge message
# To avoid infinite loop where one of the callables adds items
# to self._ready (via call_soon or otherwise).
# we create new list with current self._ready
import inspect
print(inspect.stack())
for item in list(self._ready):
item()
</code></pre></div>
<h3 dir="auto">raw log and logic flow</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="=>start long time running task and send signal to warm shutdown...
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:24,127 5325 INFO tasks[85] in loop 1
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:34,130 5325 INFO tasks[85] in loop 2
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:44,133 5325 INFO tasks[85] in loop 3
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:54,135 5325 INFO trace[124] Task horand.product_audit.tasks.dispatch_request[4136e4b7-5560-4cec-94a9-6e607da7f0db] succeeded in 30.079765408998355s: None
2019-11-20 18:40:54,257 5325 WARNING log[235] [
FrameInfo(frame=<frame object at 0x7f88806ce9d0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=264, function='close', code_context=[' print(inspect.stack())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806d6be0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=112, function='reset', code_context=[' self.close()\n'], index=0),
FrameInfo(frame=<frame object at 0x29e50e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py', lineno=96, function='asynloop', code_context=[' hub.reset()\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88807aac50>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py', lineno=596, function='start', code_context=[' c.loop(*c.loop_args())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88807db220>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=119, function='start', code_context=[' step.start(parent)\n'], index=0),
FrameInfo(frame=<frame object at 0x295e4e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py', lineno=318, function='start', code_context=[' blueprint.start(self)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888082a708>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=369, function='start', code_context=[' return self.obj.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888093ada0>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=119, function='start', code_context=[' step.start(parent)\n'], index=0),
FrameInfo(frame=<frame object at 0x28f0698>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=205, function='start', code_context=[' self.blueprint.start(self)\n'], index=0),
FrameInfo(frame=<frame object at 0x1be46e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=258, function='run', code_context=[' worker.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x1be22f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=252, function='__call__', code_context=[' ret = self.run(*args, **kwargs)\n'], index=0),
FrameInfo(frame=<frame object at 0x18be4a8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=223, function='run_from_argv', code_context=[' return self(*args, **options)\n'], index=0),
FrameInfo(frame=<frame object at 0x1baa718>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=420, function='execute', code_context=[' ).run_from_argv(self.prog_name, argv[1:], command=argv[0])\n'], index=0),
FrameInfo(frame=<frame object at 0x1b3ed78>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=488, function='handle_argv', code_context=[' return self.execute(command, argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x1a894f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=298, function='execute_from_commandline', code_context=[' return self.handle_argv(self.prog_name, argv[1:])\n'], index=0),
FrameInfo(frame=<frame object at 0x1ac5288>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=496, function='execute_from_commandline', code_context=[' super(CeleryCommand, self).execute_from_commandline(argv)))\n'], index=0),
FrameInfo(frame=<frame object at 0x1a13388>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=322, function='main', code_context=[' cmd.execute_from_commandline(argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x183db88>, filename='/usr/local/lib/python3.6/dist-packages/celery/__main__.py', lineno=16, function='main', code_context=[' _main()\n'], index=0),
FrameInfo(frame=<frame object at 0x1683f88>, filename='/usr/local/bin/celery', lineno=11, function='<module>', code_context=[' sys.exit(main())\n'], index=0)]
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Hub...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Pool...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Consumer...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Stopping Consumer...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Connection...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Events...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Tasks...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing ThreadControlConsumerStep...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing event loop...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Stopping event loop...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Stopping ThreadControlConsumerStep...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Tasks...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Events...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Connection...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Worker: Stopping Pool...
2019-11-20 18:40:55,179 5325 DEBUG bootsteps[262] | Worker: Stopping Hub...
2019-11-20 18:40:55,180 5325 WARNING log[235] [
FrameInfo(frame=<frame object at 0x7f88806ce9d0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=264, function='close', code_context=[' print(inspect.stack())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f8880609dc8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/components.py', lineno=85, function='stop', code_context=[' w.hub.close()\n'], index=0),
FrameInfo(frame=<frame object at 0x29e53d8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=151, function='send_all', code_context=[' fun(parent, *args)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e1808>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=138, function='restart', code_context=[' self.send_all(parent, method, description, propagate=propagate)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e1618>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=173, function='stop', code_context=[' description=what, propagate=False,\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888071ea48>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=268, function='_shutdown', code_context=[' self.blueprint.stop(self, terminate=not warm)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e55a0>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=253, function='stop', code_context=[' self._shutdown(warm=True)\n'], index=0),
FrameInfo(frame=<frame object at 0x28f0698>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=212, function='start', code_context=[' self.stop(exitcode=exc.code)\n'], index=0),
FrameInfo(frame=<frame object at 0x1be46e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=258, function='run', code_context=[' worker.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x1be22f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=252, function='__call__', code_context=[' ret = self.run(*args, **kwargs)\n'], index=0),
FrameInfo(frame=<frame object at 0x18be4a8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=223, function='run_from_argv', code_context=[' return self(*args, **options)\n'], index=0),
FrameInfo(frame=<frame object at 0x1baa718>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=420, function='execute', code_context=[' ).run_from_argv(self.prog_name, argv[1:], command=argv[0])\n'], index=0),
FrameInfo(frame=<frame object at 0x1b3ed78>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=488, function='handle_argv', code_context=[' return self.execute(command, argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x1a894f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=298, function='execute_from_commandline', code_context=[' return self.handle_argv(self.prog_name, argv[1:])\n'], index=0),
FrameInfo(frame=<frame object at 0x1ac5288>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=496, function='execute_from_commandline', code_context=[' super(CeleryCommand, self).execute_from_commandline(argv)))\n'], index=0),
FrameInfo(frame=<frame object at 0x1a13388>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=322, function='main', code_context=[' cmd.execute_from_commandline(argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x183db88>, filename='/usr/local/lib/python3.6/dist-packages/celery/__main__.py', lineno=16, function='main', code_context=[' _main()\n'], index=0),
FrameInfo(frame=<frame object at 0x1683f88>, filename='/usr/local/bin/celery', lineno=11, function='<module>', code_context=[' sys.exit(main())\n'], index=0)]
2019-11-20 18:40:55,180 5325 ERROR bootsteps[156] Error on stopping Hub: MessageStateError('Message already acknowledged with state: ACK',)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py", line 205, in start
self.blueprint.start(self)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 369, in start
return self.obj.start()
File "/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py", line 596, in start
c.loop(*c.loop_args())
File "/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py", line 80, in asynloop
raise WorkerShutdown(should_stop)
celery.exceptions.WorkerShutdown: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 151, in send_all
fun(parent, *args)
File "/usr/local/lib/python3.6/dist-packages/celery/worker/components.py", line 85, in stop
w.hub.close()
File "/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py", line 267, in close
item()
File "/usr/local/lib/python3.6/dist-packages/vine/promises.py", line 170, in __call__
return self.throw()
File "/usr/local/lib/python3.6/dist-packages/vine/promises.py", line 167, in __call__
retval = fun(*final_args, **final_kwargs)
File "/usr/local/lib/python3.6/dist-packages/kombu/message.py", line 132, in ack_log_error
self.ack(multiple=multiple)
File "/usr/local/lib/python3.6/dist-packages/kombu/message.py", line 125, in ack
self))
kombu.exceptions.MessageStateError: Message already acknowledged with state: ACK
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown ThreadControlConsumerStep...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Tasks...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Events...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Connection...
"><pre class="notranslate"><code class="notranslate">=>start long time running task and send signal to warm shutdown...
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:24,127 5325 INFO tasks[85] in loop 1
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:34,130 5325 INFO tasks[85] in loop 2
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:44,133 5325 INFO tasks[85] in loop 3
smite-ThinkPad-X270-W10DG 2019-11-20 18:40:54,135 5325 INFO trace[124] Task horand.product_audit.tasks.dispatch_request[4136e4b7-5560-4cec-94a9-6e607da7f0db] succeeded in 30.079765408998355s: None
2019-11-20 18:40:54,257 5325 WARNING log[235] [
FrameInfo(frame=<frame object at 0x7f88806ce9d0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=264, function='close', code_context=[' print(inspect.stack())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806d6be0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=112, function='reset', code_context=[' self.close()\n'], index=0),
FrameInfo(frame=<frame object at 0x29e50e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py', lineno=96, function='asynloop', code_context=[' hub.reset()\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88807aac50>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py', lineno=596, function='start', code_context=[' c.loop(*c.loop_args())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88807db220>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=119, function='start', code_context=[' step.start(parent)\n'], index=0),
FrameInfo(frame=<frame object at 0x295e4e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py', lineno=318, function='start', code_context=[' blueprint.start(self)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888082a708>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=369, function='start', code_context=[' return self.obj.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888093ada0>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=119, function='start', code_context=[' step.start(parent)\n'], index=0),
FrameInfo(frame=<frame object at 0x28f0698>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=205, function='start', code_context=[' self.blueprint.start(self)\n'], index=0),
FrameInfo(frame=<frame object at 0x1be46e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=258, function='run', code_context=[' worker.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x1be22f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=252, function='__call__', code_context=[' ret = self.run(*args, **kwargs)\n'], index=0),
FrameInfo(frame=<frame object at 0x18be4a8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=223, function='run_from_argv', code_context=[' return self(*args, **options)\n'], index=0),
FrameInfo(frame=<frame object at 0x1baa718>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=420, function='execute', code_context=[' ).run_from_argv(self.prog_name, argv[1:], command=argv[0])\n'], index=0),
FrameInfo(frame=<frame object at 0x1b3ed78>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=488, function='handle_argv', code_context=[' return self.execute(command, argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x1a894f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=298, function='execute_from_commandline', code_context=[' return self.handle_argv(self.prog_name, argv[1:])\n'], index=0),
FrameInfo(frame=<frame object at 0x1ac5288>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=496, function='execute_from_commandline', code_context=[' super(CeleryCommand, self).execute_from_commandline(argv)))\n'], index=0),
FrameInfo(frame=<frame object at 0x1a13388>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=322, function='main', code_context=[' cmd.execute_from_commandline(argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x183db88>, filename='/usr/local/lib/python3.6/dist-packages/celery/__main__.py', lineno=16, function='main', code_context=[' _main()\n'], index=0),
FrameInfo(frame=<frame object at 0x1683f88>, filename='/usr/local/bin/celery', lineno=11, function='<module>', code_context=[' sys.exit(main())\n'], index=0)]
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Hub...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Pool...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Closing Consumer...
2019-11-20 18:40:54,258 5325 DEBUG bootsteps[262] | Worker: Stopping Consumer...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Connection...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Events...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing Tasks...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing ThreadControlConsumerStep...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Closing event loop...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Stopping event loop...
2019-11-20 18:40:54,259 5325 DEBUG bootsteps[262] | Consumer: Stopping ThreadControlConsumerStep...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Tasks...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Events...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Consumer: Stopping Connection...
2019-11-20 18:40:55,178 5325 DEBUG bootsteps[262] | Worker: Stopping Pool...
2019-11-20 18:40:55,179 5325 DEBUG bootsteps[262] | Worker: Stopping Hub...
2019-11-20 18:40:55,180 5325 WARNING log[235] [
FrameInfo(frame=<frame object at 0x7f88806ce9d0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=264, function='close', code_context=[' print(inspect.stack())\n'], index=0),
FrameInfo(frame=<frame object at 0x7f8880609dc8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/components.py', lineno=85, function='stop', code_context=[' w.hub.close()\n'], index=0),
FrameInfo(frame=<frame object at 0x29e53d8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=151, function='send_all', code_context=[' fun(parent, *args)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e1808>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=138, function='restart', code_context=[' self.send_all(parent, method, description, propagate=propagate)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e1618>, filename='/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py', lineno=173, function='stop', code_context=[' description=what, propagate=False,\n'], index=0),
FrameInfo(frame=<frame object at 0x7f888071ea48>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=268, function='_shutdown', code_context=[' self.blueprint.stop(self, terminate=not warm)\n'], index=0),
FrameInfo(frame=<frame object at 0x7f88806e55a0>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=253, function='stop', code_context=[' self._shutdown(warm=True)\n'], index=0),
FrameInfo(frame=<frame object at 0x28f0698>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py', lineno=212, function='start', code_context=[' self.stop(exitcode=exc.code)\n'], index=0),
FrameInfo(frame=<frame object at 0x1be46e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=258, function='run', code_context=[' worker.start()\n'], index=0),
FrameInfo(frame=<frame object at 0x1be22f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=252, function='__call__', code_context=[' ret = self.run(*args, **kwargs)\n'], index=0),
FrameInfo(frame=<frame object at 0x18be4a8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/worker.py', lineno=223, function='run_from_argv', code_context=[' return self(*args, **options)\n'], index=0),
FrameInfo(frame=<frame object at 0x1baa718>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=420, function='execute', code_context=[' ).run_from_argv(self.prog_name, argv[1:], command=argv[0])\n'], index=0),
FrameInfo(frame=<frame object at 0x1b3ed78>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=488, function='handle_argv', code_context=[' return self.execute(command, argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x1a894f8>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/base.py', lineno=298, function='execute_from_commandline', code_context=[' return self.handle_argv(self.prog_name, argv[1:])\n'], index=0),
FrameInfo(frame=<frame object at 0x1ac5288>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=496, function='execute_from_commandline', code_context=[' super(CeleryCommand, self).execute_from_commandline(argv)))\n'], index=0),
FrameInfo(frame=<frame object at 0x1a13388>, filename='/usr/local/lib/python3.6/dist-packages/celery/bin/celery.py', lineno=322, function='main', code_context=[' cmd.execute_from_commandline(argv)\n'], index=0),
FrameInfo(frame=<frame object at 0x183db88>, filename='/usr/local/lib/python3.6/dist-packages/celery/__main__.py', lineno=16, function='main', code_context=[' _main()\n'], index=0),
FrameInfo(frame=<frame object at 0x1683f88>, filename='/usr/local/bin/celery', lineno=11, function='<module>', code_context=[' sys.exit(main())\n'], index=0)]
2019-11-20 18:40:55,180 5325 ERROR bootsteps[156] Error on stopping Hub: MessageStateError('Message already acknowledged with state: ACK',)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/celery/worker/worker.py", line 205, in start
self.blueprint.start(self)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 369, in start
return self.obj.start()
File "/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/usr/local/lib/python3.6/dist-packages/celery/worker/consumer/consumer.py", line 596, in start
c.loop(*c.loop_args())
File "/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py", line 80, in asynloop
raise WorkerShutdown(should_stop)
celery.exceptions.WorkerShutdown: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/celery/bootsteps.py", line 151, in send_all
fun(parent, *args)
File "/usr/local/lib/python3.6/dist-packages/celery/worker/components.py", line 85, in stop
w.hub.close()
File "/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py", line 267, in close
item()
File "/usr/local/lib/python3.6/dist-packages/vine/promises.py", line 170, in __call__
return self.throw()
File "/usr/local/lib/python3.6/dist-packages/vine/promises.py", line 167, in __call__
retval = fun(*final_args, **final_kwargs)
File "/usr/local/lib/python3.6/dist-packages/kombu/message.py", line 132, in ack_log_error
self.ack(multiple=multiple)
File "/usr/local/lib/python3.6/dist-packages/kombu/message.py", line 125, in ack
self))
kombu.exceptions.MessageStateError: Message already acknowledged with state: ACK
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown ThreadControlConsumerStep...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Tasks...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Events...
2019-11-20 18:40:55,181 5325 DEBUG bootsteps[262] | Consumer: Shutdown Connection...
</code></pre></div>
<h3 dir="auto">inspect</h3>
<p dir="auto">from above log we can see <code class="notranslate">Hub.close</code> called two times from:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="case 1
FrameInfo(frame=<frame object at 0x7f88806d6be0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=112, function='reset', code_context=[' self.close()\n'], index=0)
FrameInfo(frame=<frame object at 0x29e50e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py', lineno=96, function='asynloop', code_context=[' hub.reset()\n'], index=0)
the source code: https://github.com/celery/celery/blob/master/celery/worker/loops.py#L88
case 2. FrameInfo(frame=<frame object at 0x7f8880609dc8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/components.py', lineno=85, function='stop', code_context=[' w.hub.close()\n'], index=0)
the source code: https://github.com/celery/celery/blob/master/celery/worker/components.py#L85"><pre class="notranslate"><code class="notranslate">case 1
FrameInfo(frame=<frame object at 0x7f88806d6be0>, filename='/usr/local/lib/python3.6/dist-packages/kombu/asynchronous/hub.py', lineno=112, function='reset', code_context=[' self.close()\n'], index=0)
FrameInfo(frame=<frame object at 0x29e50e8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/loops.py', lineno=96, function='asynloop', code_context=[' hub.reset()\n'], index=0)
the source code: https://github.com/celery/celery/blob/master/celery/worker/loops.py#L88
case 2. FrameInfo(frame=<frame object at 0x7f8880609dc8>, filename='/usr/local/lib/python3.6/dist-packages/celery/worker/components.py', lineno=85, function='stop', code_context=[' w.hub.close()\n'], index=0)
the source code: https://github.com/celery/celery/blob/master/celery/worker/components.py#L85
</code></pre></div>
<p dir="auto">from source code we can sure the <code class="notranslate">self._ready</code> would <strong>not to be reset</strong> to empty after execute, so the exception <code class="notranslate">Message already acknowledged with state: ACK</code> was expected by code but not to me.</p>
<p dir="auto">My question is:</p>
<ol dir="auto">
<li>if we should <code class="notranslate">reset</code> the <code class="notranslate">self._ready</code> after execute?</li>
<li>why we need call <code class="notranslate">case 1</code> ? , it doesn't make any sense in my opinion</li>
</ol> | 0 |
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: Yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Windows 10</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: binary (pip)</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.5.0-dev20171210 (nightly from today)</li>
<li><strong>Python version</strong>: 3.6.2</li>
</ul>
<p dir="auto"><code class="notranslate">ArgMax</code> crashes with <code class="notranslate">no gradient</code> error. I had a working version before I made slight adjustments to my code. I am very confused how this error can happen.</p>
<p dir="auto">Stacktrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\learn_runner.py", line 46, in _execute_schedule
return task()
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 377, in train
saving_listeners=self._saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 824, in _call_train
saving_listeners=saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 314, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 743, in _train_model
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 725, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 162, in _model_fn
add_summaries)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 235, in _gan_model_fn
labels=None)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\head_impl.py", line 189, in create_estimator_spec
self._discriminator_optimizer)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\train.py", line 540, in gan_train_ops
**kwargs)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\training\python\training\training.py", line 447, in create_train_op
colocate_gradients_with_ops=colocate_gradients_with_ops)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\training\optimizer.py", line 456, in compute_gradients
colocate_gradients_with_ops=colocate_gradients_with_ops)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\ops\gradients_impl.py", line 581, in gradients
(op.name, op.type))
LookupError: No gradient defined for operation 'Generator/cond/generator/generator/while/BasicDecoderStep/TrainingHelperSample/ArgMax' (op type: ArgMax)"><pre class="notranslate"><code class="notranslate"> File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\learn_runner.py", line 46, in _execute_schedule
return task()
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 377, in train
saving_listeners=self._saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 824, in _call_train
saving_listeners=saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 314, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 743, in _train_model
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 725, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 162, in _model_fn
add_summaries)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 235, in _gan_model_fn
labels=None)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\head_impl.py", line 189, in create_estimator_spec
self._discriminator_optimizer)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\train.py", line 540, in gan_train_ops
**kwargs)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\training\python\training\training.py", line 447, in create_train_op
colocate_gradients_with_ops=colocate_gradients_with_ops)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\training\optimizer.py", line 456, in compute_gradients
colocate_gradients_with_ops=colocate_gradients_with_ops)
File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\ops\gradients_impl.py", line 581, in gradients
(op.name, op.type))
LookupError: No gradient defined for operation 'Generator/cond/generator/generator/while/BasicDecoderStep/TrainingHelperSample/ArgMax' (op type: ArgMax)
</code></pre></div> | <p dir="auto">LookupError: No gradient defined for operation 'Argmax' (op type: Argmax)</p> | 1 |
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.5.0</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">I am trying to set up Airflow Celery to use sentinel. However, we have multiple sentinel instances up and running. So referring to the examples on the internet, I tried to pass multiple sentinel URL as below in ENV VAR.</p>
<p dir="auto"><code class="notranslate">AIRFLOW__CELERY__BROKER_URL='sentinel://redis_sentinel1:26379;sentinel://redis_sentinel2:26379'</code> (tried with/without quote)</p>
<p dir="auto">After executing, the worker keeps throwing errors as below:</p>
<blockquote>
<p dir="auto">Traceback (most recent call last):<br>
File "", line 1, in <br>
File "/usr/local/lib/python3.8/urllib/parse.py", line 177, in port<br>
raise ValueError(message) from None<br>
<strong>ValueError: Port could not be cast to integer value as '26379;sentinel:'</strong></p>
</blockquote>
<p dir="auto">From the error, it looks like the parser is NOT separating sentinel URLs with a semicolon separator. Is there any workaround for it?</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">Using a semicolon separator, sentinel URLs should be separated, and the Redis connection pool should make use of all the sentinel URLs.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Try to pass multiple sentinel URLs to <code class="notranslate">AIRFLOW__CELERY__BROKER_URL</code> environment variables and then try to bring up the airflow workers</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">ubuntu</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Official Apache Airflow Helm Chart</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul> | <h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.4.3</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">When configuring Airflow/Celery to use Redis Sentinel as a broker, the following pops up:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="airflow.exceptions.AirflowException: The broker you configured does not support SSL_ACTIVE to be True. Please use RabbitMQ or Redis if you would like to use SSL for broker."><pre class="notranslate"><code class="notranslate">airflow.exceptions.AirflowException: The broker you configured does not support SSL_ACTIVE to be True. Please use RabbitMQ or Redis if you would like to use SSL for broker.
</code></pre></div>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">Celery has supported TLS on Redis Sentinel <a href="https://docs.celeryq.dev/en/latest/history/whatsnew-5.1.html#support-redis-sentinel-with-ssl" rel="nofollow">for a while</a> now.</p>
<p dir="auto">It looks like <a href="https://github.com/apache/airflow/blob/main/airflow/config_templates/default_celery.py#L68-L88">this piece of code</a> explicitly prohibits from passing a valid Redis Sentinel TLS configuration through to Celery. (Since Sentinel broker URL's are prefixed with <code class="notranslate">sentinel://</code> instead of <code class="notranslate">redis://</code>.)</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">This problem can be reproduced by deploying Airflow using Docker with the following environment variables:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AIRFLOW__CELERY__BROKER_URL=sentinel://sentinel1:26379;sentinel://sentinel2:26379;sentinel://sentinel3:26379
AIRFLOW__CELERY__SSL_ACTIVE=true
AIRFLOW__CELERY_BROKER_TRANSPORT_OPTIONS__MASTER_NAME='some-master-name'
AIRFLOW__CELERY_BROKER_TRANSPORT_OPTIONS__PASSWORD='some-password'
AIRFLOW__LOGGING__LOGGING_LEVEL=DEBUG"><pre class="notranslate"><code class="notranslate">AIRFLOW__CELERY__BROKER_URL=sentinel://sentinel1:26379;sentinel://sentinel2:26379;sentinel://sentinel3:26379
AIRFLOW__CELERY__SSL_ACTIVE=true
AIRFLOW__CELERY_BROKER_TRANSPORT_OPTIONS__MASTER_NAME='some-master-name'
AIRFLOW__CELERY_BROKER_TRANSPORT_OPTIONS__PASSWORD='some-password'
AIRFLOW__LOGGING__LOGGING_LEVEL=DEBUG
</code></pre></div>
<p dir="auto">Note that I'm not 100% certain of the syntax for the password environment var. I can't get to the point of testing this because without TLS connections to our internal brokers are denied (because they require TLS), and with TLS it doesn't attempt a connection because of the earlier linked code.</p>
<p dir="auto">I've verified with the reference <code class="notranslate">redis-cli</code> that the settings we use for <code class="notranslate">master-name</code> does result in a valid response and the Sentinel set-up works as expected.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Docker (apache/airflow:2.4.3-python3.10)</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other Docker-based deployment</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">Deployed using Nomad.</p>
<h3 dir="auto">Anything else</h3>
<p dir="auto">This is my first issue with this open source project. Please let me know if there's more relevant information I can provide to follow through on this issue.</p>
<p dir="auto">I will try to make some time available soon to see if a simple code change in the earlier mentioned file would work, but as this is my first issue here I would still have to set-up a full development environment.</p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Yes I am willing to submit a PR!</li>
</ul>
<p dir="auto">If this is indeed a simple fix I'd be willing to look into making a PR. I would like some feedback on the problem first though if possible!</p>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul> | 1 |
<p dir="auto">When I try example Mobx</p>
<p dir="auto">Error: MobX observer: Store 'store' is not available! Make sure it is provided by some Provider<br>
at <a href="http://localhost:3000/_next/-/commons.js:8459:46" rel="nofollow">http://localhost:3000/_next/-/commons.js:8459:46</a><br>
at Array.forEach (native)<br>
at <a href="http://localhost:3000/_next/-/commons.js:8456:17" rel="nofollow">http://localhost:3000/_next/-/commons.js:8456:17</a><br>
at _fn.render (<a href="http://localhost:3000/_next/-/commons.js:8435:31" rel="nofollow">http://localhost:3000/_next/-/commons.js:8435:31</a>)<br>
at _fn.render (<a href="http://localhost:3000/_next/-/main.js:7616:30" rel="nofollow">http://localhost:3000/_next/-/main.js:7616:30</a>)<br>
at _fn.withHandleError (<a href="http://localhost:3000/_next/-/main.js:1962:17" rel="nofollow">http://localhost:3000/_next/-/main.js:1962:17</a>)<br>
at _fn [as render] (<a href="http://localhost:3000/_next/-/main.js:2004:24" rel="nofollow">http://localhost:3000/_next/-/main.js:2004:24</a>)<br>
at <a href="http://localhost:3000/_next/-/commons.js:28328:21" rel="nofollow">http://localhost:3000/_next/-/commons.js:28328:21</a><br>
at measureLifeCyclePerf (<a href="http://localhost:3000/_next/-/commons.js:27607:12" rel="nofollow">http://localhost:3000/_next/-/commons.js:27607:12</a>)<br>
at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (<a href="http://localhost:3000/_next/-/commons.js:28327:25" rel="nofollow">http://localhost:3000/_next/-/commons.js:28327:25</a>)</p> | <p dir="auto">For some reason if I upgrade to beta 19 of next I get an error about the mobx store not being available. I'm using a provider and then injected the store into my components. Anyone else using mobx with next getting this error when upgrading?</p> | 1 |
<p dir="auto">As of today interacting with input and outputs of dynamically loaded components requires access to potentially "private" fields of a component. To illustrate it with a concrete example let's say that I want to load, using <code class="notranslate">DynamicComponentLoader</code>, a following component:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Component({
selector: 'my-modal-content'
template: `...`
})
export class MyModalContent {
@Output() close = new EventEmitter();
..
}"><pre class="notranslate">@<span class="pl-v">Component</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">selector</span>: <span class="pl-s">'my-modal-content'</span>
<span class="pl-s1">template</span>: <span class="pl-s">`...`</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">MyModalContent</span> <span class="pl-kos">{</span>
@<span class="pl-v">Output</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">close</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">EventEmitter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">.</span><span class="pl-kos">.</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">After loading, I would like to subscribe to the <strong>close</strong> event which sounds like an easy task:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="dcl.loadIntoLocation(content, this._elRef, 'content').then((componentRef) => {
componentRef.instance.close.subscribe((closeEvent) => {
...
});
});"><pre class="notranslate"><span class="pl-s1">dcl</span><span class="pl-kos">.</span><span class="pl-en">loadIntoLocation</span><span class="pl-kos">(</span><span class="pl-s1">content</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_elRef</span><span class="pl-kos">,</span> <span class="pl-s">'content'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">componentRef</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">componentRef</span><span class="pl-kos">.</span><span class="pl-c1">instance</span><span class="pl-kos">.</span><span class="pl-c1">close</span><span class="pl-kos">.</span><span class="pl-en">subscribe</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">closeEvent</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
...
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Unfortunately <strong>this method requires me to use <code class="notranslate">EventEmmiter</code>’s instance name instead of event name</strong>. Why this could be a problem? Well, nothing stops people from implementing <code class="notranslate">MyModalContent</code> like so:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Component({
selector: 'my-modal-content'
template: `...`
})
export class MyModalContent {
@Output('close') _close = new EventEmitter();
..
}"><pre class="notranslate">@<span class="pl-v">Component</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">selector</span>: <span class="pl-s">'my-modal-content'</span>
<span class="pl-s1">template</span>: <span class="pl-s">`...`</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">MyModalContent</span> <span class="pl-kos">{</span>
@<span class="pl-v">Output</span><span class="pl-kos">(</span><span class="pl-s">'close'</span><span class="pl-kos">)</span> <span class="pl-c1">_close</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">EventEmitter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">.</span><span class="pl-kos">.</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>In this case the contract is broken as the only thing I should be knowing of is event name.</strong>. Instead I need to subscribe using a private field name (<code class="notranslate">_close</code>).</p>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mhevery/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mhevery">@mhevery</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/adamdbradley/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/adamdbradley">@adamdbradley</a> as discussed yesterday</p> | <p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
There is no way to set <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/inputs/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/inputs">@inputs</a> or subscribe to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/output/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/output">@output</a> events of the Component created by <code class="notranslate">NgComponentOutlet</code>.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
I expect some to set values and to subscribe events.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
At least, we should have the same level of functionality as <code class="notranslate">ViewContainerRef.createComponent()</code> which is roughly the programatic equivalent of <code class="notranslate">NgComponentOutlet</code>. That function returns a <code class="notranslate">ComponentRef<any></code> which provides an instance property that allows direct access to the class instance of the Component. The original feature request for <code class="notranslate">NgComponentOutlet</code> defined an event on the directive that would fire and pass this <code class="notranslate">ComponentRef</code> object after creation. This did not make it into the current implementation and I see no other alternatives to access inputs/outputs.</p>
<p dir="auto">Supporting only Components with no inputs or outputs severely limits the usefulness of <code class="notranslate">NgComponentOutlet</code>.</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 4.0.0-rc.1</li>
</ul> | 1 |
<h4 dir="auto">Data Visualization with D3: Work with Data in D3</h4>
<p dir="auto"><a href="http://beta.freecodecamp.com/en/challenges/data-visualization-with-d3/work-with-data-in-d3" rel="nofollow">http://beta.freecodecamp.com/en/challenges/data-visualization-with-d3/work-with-data-in-d3</a></p>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">Submit and incorrect answer then submit the correct answer. The tests and output will say the solution is incorrect.</p>
<p dir="auto">Clear your localStorage and try the correct solution and the challenge will pass.</p>
<h4 dir="auto">Browser Information</h4>
<ul dir="auto">
<li>Browser Name, Version: Chrome</li>
<li>Operating System: Mac</li>
<li>Mobile, Desktop, or Tablet: Desktop</li>
</ul>
<h4 dir="auto">Solution Code</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
// Add your code below this line
d3.select('body').selectAll('h2')
.data(dataset)
.enter()
.append('h2')
.text('New Title')
// Add your code above this line
</script>
</body>
"><pre class="notranslate">
<span class="pl-c1"><</span><span class="pl-ent">body</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">script</span><span class="pl-c1">></span>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
// Add your code below this line
d3.select('body').selectAll('h2')
.data(dataset)
.enter()
.append('h2')
.text('New Title')
// Add your code above this line
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">script</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">body</span><span class="pl-c1">></span></pre></div> | 1 |
|
<h2 dir="auto">Steps to Reproduce</h2>
<ul dir="auto">
<li>create new project</li>
<li>add a TextFormField widget</li>
<li>run and compare with android native</li>
</ul>
<p dir="auto"><strong>Native Android</strong><br>
-> new Android Studio project - selected "Login Activity"-template</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5072232/39352289-8b610300-4a04-11e8-82fc-7393ec6fc025.png"><img src="https://user-images.githubusercontent.com/5072232/39352289-8b610300-4a04-11e8-82fc-7393ec6fc025.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Flutter</strong><br>
-> new clean project - TextFormField added:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5072232/39352420-eea45728-4a04-11e8-8d52-69fdbd232972.png"><img src="https://user-images.githubusercontent.com/5072232/39352420-eea45728-4a04-11e8-8d52-69fdbd232972.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5072232/39352374-cc122924-4a04-11e8-946e-68006e812ce1.png"><img src="https://user-images.githubusercontent.com/5072232/39352374-cc122924-4a04-11e8-946e-68006e812ce1.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Logs</h2>
<p dir="auto">Launching lib/main.dart on Nexus 5 in debug mode...<br>
Initializing gradle... 0,8s<br>
Resolving dependencies... 1,1s<br>
Running 'gradlew assembleDebug'... 7,8s<br>
Built build\app\outputs\apk\debug\app-debug.apk (30.4MB).<br>
Installing build\app\outputs\apk\app.apk... 9,4s<br>
I/FlutterActivityDelegate( 8200): onResume setting current activity to this<br>
Syncing files to device Nexus 5... 2,9s</p>
<p dir="auto">To hot reload your app on the fly, press "r". To restart the app entirely, press "R".<br>
An Observatory debugger and profiler on Nexus 5 is available at: <a href="http://127.0.0.1:8104/" rel="nofollow">http://127.0.0.1:8104/</a><br>
For a more detailed help message, press "h". To quit, press "q".</p>
<p dir="auto">Run <code class="notranslate">flutter analyze</code> and attach any output of that command also.</p>
<p dir="auto">Analyzing C:\Users\x\Projekte\x\flutter\testapp...<br>
No issues found!</p>
<h2 dir="auto">Flutter Doctor</h2>
<p dir="auto">[√] Flutter (Channel beta, v0.3.1, on Microsoft Windows [Version 10.0.16299.371], locale de-DE)<br>
• Flutter version 0.3.1 at C:\Users\x\Projekte\SDK\flutter<br>
• Framework revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/12bbaba9ae044d0ea77da4dd5e4db15eed403f09/hovercard" href="https://github.com/flutter/flutter/commit/12bbaba9ae044d0ea77da4dd5e4db15eed403f09"><tt>12bbaba</tt></a> (7 days ago), 2018-04-19 23:36:15 -0700<br>
• Engine revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/09d05a38912a3c1a906e95099cac9a7e14fae85f/hovercard" href="https://github.com/flutter/flutter/commit/09d05a38912a3c1a906e95099cac9a7e14fae85f"><tt>09d05a3</tt></a><br>
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b</p>
<p dir="auto">[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)<br>
• Android SDK at C:\Users\x\AppData\Local\Android\sdk<br>
• Android NDK location not configured (optional; useful for native profiling support)<br>
• Platform android-27, build-tools 27.0.3<br>
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java<br>
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)<br>
• All Android licenses accepted.</p>
<p dir="auto">[√] Android Studio (version 3.1)<br>
• Android Studio at C:\Program Files\Android\Android Studio<br>
• Flutter plugin version 23.2.2<br>
• Dart plugin version 173.4700<br>
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)</p>
<p dir="auto">[√] VS Code, 64-bit edition (version 1.22.2)<br>
• VS Code at C:\Program Files\Microsoft VS Code<br>
• Dart Code extension version 2.11.2</p>
<p dir="auto">[√] Connected devices (1 available)<br>
• Nexus 5 • 02cd7a87d023fb75 • android-arm • Android 6.0.1 (API 23)</p>
<p dir="auto">• No issues found!</p> | <p dir="auto">code:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var pictureRecorder = ui.PictureRecorder();
var canvas = Canvas(pictureRecorder, Rect.fromLTWH(0.0, 0.0, image.width.toDouble(), image.height.toDouble()));
var paint = Paint();
paint.isAntiAlias = true;
var src = Rect.fromLTWH(
0.0, 0.0, image.width.toDouble(), image.height.toDouble());
var dst =
Rect.fromLTWH(0.0, 0.0, image.width.toDouble(), image.height.toDouble());
canvas.drawImageRect(image, src, dst, paint);
canvas.drawRect(Rect.fromLTWH(0.0, 0.0, 100.0, 100.0), paint);
var pic = pictureRecorder.endRecording();
ui.Image img = pic.toImage(image.width, image.height);`
.......to Uint8List"><pre class="notranslate"><span class="pl-k">var</span> pictureRecorder <span class="pl-k">=</span> ui.<span class="pl-c1">PictureRecorder</span>();
<span class="pl-k">var</span> canvas <span class="pl-k">=</span> <span class="pl-c1">Canvas</span>(pictureRecorder, <span class="pl-c1">Rect</span>.<span class="pl-en">fromLTWH</span>(<span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, image.width.<span class="pl-en">toDouble</span>(), image.height.<span class="pl-en">toDouble</span>()));
<span class="pl-k">var</span> paint <span class="pl-k">=</span> <span class="pl-c1">Paint</span>();
paint.isAntiAlias <span class="pl-k">=</span> <span class="pl-c1">true</span>;
<span class="pl-k">var</span> src <span class="pl-k">=</span> <span class="pl-c1">Rect</span>.<span class="pl-en">fromLTWH</span>(
<span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, image.width.<span class="pl-en">toDouble</span>(), image.height.<span class="pl-en">toDouble</span>());
<span class="pl-k">var</span> dst <span class="pl-k">=</span>
<span class="pl-c1">Rect</span>.<span class="pl-en">fromLTWH</span>(<span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, image.width.<span class="pl-en">toDouble</span>(), image.height.<span class="pl-en">toDouble</span>());
canvas.<span class="pl-en">drawImageRect</span>(image, src, dst, paint);
canvas.<span class="pl-en">drawRect</span>(<span class="pl-c1">Rect</span>.<span class="pl-en">fromLTWH</span>(<span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">100.0</span>, <span class="pl-c1">100.0</span>), paint);
<span class="pl-k">var</span> pic <span class="pl-k">=</span> pictureRecorder.<span class="pl-en">endRecording</span>();
ui.<span class="pl-c1">Image</span> img <span class="pl-k">=</span> pic.<span class="pl-en">toImage</span>(image.width, image.height);`
.......to <span class="pl-c1">Uint8List</span></pre></div>
<p dir="auto">use image.memory widget load it just can see a rect</p> | 0 |
<p dir="auto">I'm trying to install numpy from source but I'm seeing a lot of C99 errors.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ python -s setup.py --no-user-cfg build
$ python -s setup.py --no-user-cfg install --prefix=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-37xrxjmnbitsruc7alrutzpvdil2xhhy --single-version-externally-managed --root=/"><pre class="notranslate">$ <span class="pl-s1">python -s setup.py --no-user-cfg build</span>
$ <span class="pl-s1">python -s setup.py --no-user-cfg install --prefix=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/py-numpy-1.17.0-37xrxjmnbitsruc7alrutzpvdil2xhhy --single-version-externally-managed --root=/</span></pre></div>
<h3 dir="auto">Error message:</h3>
<p dir="auto">I see hundreds of errors like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_bool':
numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (npy_intp i = 1; i < num; i++) {
^
numpy/core/src/npysort/radixsort.c.src:112:5: note: use option -std=c99 or -std=gnu99 to compile your code"><pre class="notranslate"><code class="notranslate">numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_bool':
numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (npy_intp i = 1; i < num; i++) {
^
numpy/core/src/npysort/radixsort.c.src:112:5: note: use option -std=c99 or -std=gnu99 to compile your code
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<ul dir="auto">
<li>Linux CentOS 7</li>
<li>GCC 4.8.5</li>
<li>Python 3.7.4</li>
<li>Numpy 1.17.0</li>
</ul> | <p dir="auto">Cannot build numpy v1.17.0 on CentOS 7.<br>
Previous version works fine.<br>
I'm seeing a lot of C99/C11 features in error message, and avx512f.<br>
Not sure if the required <code class="notranslate">--std</code> option is set but I don't think gcc 4.8.5 (the system default compiler on CentOS 7) can handle all of that.</p>
<h3 dir="auto">Reproducing code example:</h3>
<p dir="auto">Simply build the wheel on CentOS 7 with python3.</p>
<h3 dir="auto">Error message:</h3>
<p dir="auto">Some error log attached.<br>
The entire story is too long to be pasted here.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:5:3: warning: implicit declaration of function '__builtin_mul_overflow' [-Wimplicit-function-declaration]
#6 356.1 __builtin_mul_overflow(5, 5, (int*)5);
#6 356.1 ^
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 _configtest.o: In function `main':
#6 356.1 /tmp/pip-req-build-poiltggx/_configtest.c:5: undefined reference to `__builtin_mul_overflow'
#6 356.1 collect2: error: ld returned 1 exit status
#6 356.1 failure.
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:7:16: warning: unused variable 'r' [-Wunused-variable]
#6 356.1 volatile int r = __builtin_cpu_supports("sse");
#6 356.1 ^
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:7:3: error: Parameter to builtin not valid: avx512f
#6 356.1 volatile int r = __builtin_cpu_supports("avx512f");
#6 356.1 ^
#6 356.1 _configtest.c:7:16: warning: unused variable 'r' [-Wunused-variable]
#6 356.1 volatile int r = __builtin_cpu_supports("avx512f");
#6 356.1 ^
#6 356.1 failure.
#6 356.1 removing: _configtest.c _configtest.o
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest"><pre class="notranslate"><code class="notranslate">#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:5:3: warning: implicit declaration of function '__builtin_mul_overflow' [-Wimplicit-function-declaration]
#6 356.1 __builtin_mul_overflow(5, 5, (int*)5);
#6 356.1 ^
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 _configtest.o: In function `main':
#6 356.1 /tmp/pip-req-build-poiltggx/_configtest.c:5: undefined reference to `__builtin_mul_overflow'
#6 356.1 collect2: error: ld returned 1 exit status
#6 356.1 failure.
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:7:16: warning: unused variable 'r' [-Wunused-variable]
#6 356.1 volatile int r = __builtin_cpu_supports("sse");
#6 356.1 ^
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 _configtest.c: In function 'main':
#6 356.1 _configtest.c:7:3: error: Parameter to builtin not valid: avx512f
#6 356.1 volatile int r = __builtin_cpu_supports("avx512f");
#6 356.1 ^
#6 356.1 _configtest.c:7:16: warning: unused variable 'r' [-Wunused-variable]
#6 356.1 volatile int r = __builtin_cpu_supports("avx512f");
#6 356.1 ^
#6 356.1 failure.
#6 356.1 removing: _configtest.c _configtest.o
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest
#6 356.1 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 356.1
#6 356.1 compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
#6 356.1 gcc: _configtest.c
#6 356.1 gcc -pthread _configtest.o -o _configtest
#6 356.1 success!
#6 356.1 removing: _configtest.c _configtest.o _configtest.o.d _configtest
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#6 358.3 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 358.3
#6 358.3 compile options: '-Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -c'
#6 358.3 gcc: build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.c
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_bool':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: note: use option -std=c99 or -std=gnu99 to compile your code
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_bool':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_byte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_byte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ubyte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ubyte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_short':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_short':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ushort':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ushort':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_int':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_int':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_uint':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_uint':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_long':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_long':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ulong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ulong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_longlong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_longlong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ulonglong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ulonglong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -c build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.c -o build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.o -MMD -MF build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.o.d" failed with exit status 1
#6 358.3 ----------------------------------------
#6 358.4 ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-poiltggx/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-poiltggx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-50nzprh1/install-record.txt --single-version-externally-managed --compile Check the logs for full command output."><pre class="notranslate"><code class="notranslate">#6 358.3 C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
#6 358.3
#6 358.3 compile options: '-Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -c'
#6 358.3 gcc: build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.c
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_bool':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: note: use option -std=c99 or -std=gnu99 to compile your code
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_bool':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_byte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_byte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ubyte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ubyte':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_short':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_short':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ushort':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ushort':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_int':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_int':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_uint':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_uint':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_long':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_long':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ulong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ulong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_longlong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_longlong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'radixsort_ulonglong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:112:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 numpy/core/src/npysort/radixsort.c.src: In function 'aradixsort_ulonglong':
#6 358.3 numpy/core/src/npysort/radixsort.c.src:202:5: error: 'for' loop initial declarations are only allowed in C99 mode
#6 358.3 for (npy_intp i = 1; i < num; i++) {
#6 358.3 ^
#6 358.3 error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.6/numpy/core/src/common -Ibuild/src.linux-x86_64-3.6/numpy/core/src/npymath -c build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.c -o build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.o -MMD -MF build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/numpy/core/src/npysort/radixsort.o.d" failed with exit status 1
#6 358.3 ----------------------------------------
#6 358.4 ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-poiltggx/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-poiltggx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-50nzprh1/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<p dir="auto">CentOS 7<br>
Default python 3 (3.6)<br>
Default gcc (4.8)</p> | 1 |
<p dir="auto">This happens both locally and on <a href="https://travis-ci.org/angular/angular/jobs/62268311" rel="nofollow">Travis</a>.</p>
<p dir="auto">You get something like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 134 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 128 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 211 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 121 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 120 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 124 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 121 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 129 μs
[13:53:13] Starting 'cleanup.builder'...
..."><pre class="notranslate"><code class="notranslate">...
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 134 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 128 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 211 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 121 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 120 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 124 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 125 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 121 μs
[13:53:13] Starting 'cleanup.builder'...
[13:53:13] Finished 'cleanup.builder' after 129 μs
[13:53:13] Starting 'cleanup.builder'...
...
</code></pre></div> | <ul class="contains-task-list">
<li><strong>I'm submitting a ...</strong></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> bug report</li>
</ul>
<p dir="auto"><strong>Current behavior</strong><br>
I'm using ComponentResolver to render dynamically 'some'(all names - just alias) component to custom selector on a body.<br>
Like that:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class SomeClass {
constructor(private resolver:ComponentResolver, private injector:Injector, private appRef:ApplicationRef) {
}
public renderComponent() {
return this.resolver
.resolveComponent(SomeComponent)
.then((factory:ComponentFactory<SomeComponent>) => {
let cmpRef:ComponentRef<SomeComponent> = factory.create(this.injector, null, `.some-class`);
(<any>this.appRef)._loadComponent(cmpRef);
return cmpRef;
});
}
}"><pre class="notranslate"><code class="notranslate">class SomeClass {
constructor(private resolver:ComponentResolver, private injector:Injector, private appRef:ApplicationRef) {
}
public renderComponent() {
return this.resolver
.resolveComponent(SomeComponent)
.then((factory:ComponentFactory<SomeComponent>) => {
let cmpRef:ComponentRef<SomeComponent> = factory.create(this.injector, null, `.some-class`);
(<any>this.appRef)._loadComponent(cmpRef);
return cmpRef;
});
}
}
</code></pre></div>
<p dir="auto">This works for application itself. But when I try to test it (Jasmine 2.4 and Karma, Webpack for test build):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import {it, inject, describe, expect, beforeEach, beforeEachProviders, fakeAsync, tick} from '@angular/core/testing';
import {ComponentResolver, Injector, ApplicationRef, provide} from '@angular/core';
import {ReflectorComponentResolver} from '@angular/core/src/linker/component_resolver';
import {SomeClass} from './some-class';
describe('SomeClass', () => {
let someClassInstance:SomeClass;
let resolver:ComponentResolver;
beforeEachProviders(() => [
provide(ComponentResolver, {
useClass: ReflectorComponentResolver
}),
Injector,
ApplicationRef,
SomeClass
]);
beforeEach(inject([ComponentResolver, SomeClass],
(cmpRes:ComponentResolver, someClass:SomeClass) => {
resolver = cmpRes;
someClassInstance = someClass;
}));
it('renderComponent method should render component', fakeAsync(() => {
spyOn(resolver, 'resolveComponent').and.callThrough();
someClassInstance.renderComponent();
tick();
expect(resolver.resolveComponent).toHaveBeenCalled();
}));
});"><pre class="notranslate"><code class="notranslate">import {it, inject, describe, expect, beforeEach, beforeEachProviders, fakeAsync, tick} from '@angular/core/testing';
import {ComponentResolver, Injector, ApplicationRef, provide} from '@angular/core';
import {ReflectorComponentResolver} from '@angular/core/src/linker/component_resolver';
import {SomeClass} from './some-class';
describe('SomeClass', () => {
let someClassInstance:SomeClass;
let resolver:ComponentResolver;
beforeEachProviders(() => [
provide(ComponentResolver, {
useClass: ReflectorComponentResolver
}),
Injector,
ApplicationRef,
SomeClass
]);
beforeEach(inject([ComponentResolver, SomeClass],
(cmpRes:ComponentResolver, someClass:SomeClass) => {
resolver = cmpRes;
someClassInstance = someClass;
}));
it('renderComponent method should render component', fakeAsync(() => {
spyOn(resolver, 'resolveComponent').and.callThrough();
someClassInstance.renderComponent();
tick();
expect(resolver.resolveComponent).toHaveBeenCalled();
}));
});
</code></pre></div>
<p dir="auto">ReflectorComponentResolver(I'm using it, because ComponentResolver is just an abstract class) throws an exception:<br>
<code class="notranslate">Error: No precompiled component SomeComponent found</code><br>
And for sure promise is never resolved.</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
I would like ComponentResolver(or any inherited class) to resolve component in unit tests. Or it would be great to provide any documentation - how to avoid it, if this behavior is expected.</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.1</li>
<li><strong>Browser:</strong> [ PhantomJS2 ]</li>
<li><strong>Language:</strong> [ TypeScript 1.9 ]</li>
</ul> | 0 |
<p dir="auto">Hi,</p>
<p dir="auto">I have an annoying behavior that prevents me to type the character "]". Instead it folds current-line.</p>
<p dir="auto">On Azerty layout the ] can be typed with : AltGr + 0 .In the keybindings the current line folding should be triggered with Ctrl + Alt + ]. So there is some kind of conflict...</p>
<p dir="auto">Thanks,</p>
<p dir="auto">[email protected], Windows 7 FR, azerty keyboard layout</p> | <p dir="auto">Original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28529842" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/1625" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/1625/hovercard" href="https://github.com/atom/atom/issues/1625">atom/atom#1625</a></p>
<hr>
<p dir="auto">Use <a href="https://atom.io/packages/keyboard-localization" rel="nofollow">https://atom.io/packages/keyboard-localization</a> until this issue gets fixed (should be in the Blink upstream).</p> | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.