问题标签 [luigi]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
810 浏览

python - 将 tsv 文件从本地文件系统移动到 luigi 中的 S3

以下程序不输出任何内容,也不抛出任何错误。我是否遗漏了课堂上的run()方法形式的东西to_S3()

该类的output()方法Mysql_to_tsv()是:

请帮助该任务的正确类实现。

0 投票
1 回答
322 浏览

luigi - 使用 luigi 构建 hadoop 作业管道时,如何调试我的任务?

我正在使用luigi作为 hadoop 作业管道。我阅读了示例和文档,但在将作业推送到 hadoop 服务器之前找不到如何调试我的脚本?

更具体地说,我需要处理一个大数据集,并且运行时间很长,我更喜欢在小测试数据集中测试作业而不是在真实数据集中运行它。

0 投票
1 回答
1072 浏览

python - 在 luigi 中处理 unicode

我有几个以 UTF-8 编码的文本文件。我正在构建一个数据流,luigi我想要的是将文件一个一个地读入 unicode 字符串,清理它们,最后将它们写入一些新的 UTF-8 文件。问题是,在类的run方法中,CleanText我似乎无法将 unicode 与luigi.LocalTarget. 任何想法将不胜感激!

顺便说一句,我需要使用 unicode 以标准化方式处理重音字符。这是我的代码:

0 投票
2 回答
3550 浏览

python - Luigi 可以传播异常或返回任何结果吗?

我正在使用 Luigi 启动一些管道。我们举一个简单的例子

现在假设myTask在执行期间引发异常。我所能拥有的只是来自 luigi 的显示异常的日志。

luigi 有什么方法可以传播它或至少返回一个failure状态?

然后,我将能够使我的程序根据该状态做出反应。

谢谢。

编辑 我在存储结果时忘记指定 luigi 的输出是针对数据库的。如果引发异常,则不会存储任何结果,但不会将异常传播到 luigi。我想知道路易吉是否可以选择拥有这个。

0 投票
2 回答
1189 浏览

python - Persist Completed Pipeline in Luigi Visualiser

I'm starting to port a nightly data pipeline from a visual ETL tool to Luigi, and I really enjoy that there is a visualiser to see the status of jobs. However, I've noticed that a few minutes after the last job (named MasterEnd) completes, all of the nodes disappear from the graph except for MasterEnd. This is a little inconvenient, as I'd like to see that everything is complete for the day/past days.

Further, if in the visualiser I go directly to the last job's URL, it can't find any history that it ran: Couldn't find task MasterEnd(date=2015-09-17, base_url=http://aws.east.com/, log_dir=/home/ubuntu/logs/). I have verified that it ran successfully this morning.

One thing to note is that I have a cron that runs this pipeline every 15 minutes to check for a file on S3. If it exists, it runs, otherwise it stops. I'm not sure if that is causing the removal of tasks from the visualiser or not. I've noticed it generates a new PID every run, but I couldn't find a way to persist one PID/day in the docs.

So, my questions: Is it possible to persist the completed graph for the current day in the visualiser? And is there a way to see what has happened in the past?

Appreciate all the help

0 投票
0 回答
1199 浏览

python - python luigi 意外死亡,退出代码为 -11

如果我让 1 个工作人员执行任务,我有一个数据管道luigi可以正常工作。但是,如果我放置 > 1 个工作人员,那么它会在具有 2 个依赖项的阶段中死亡(意外退出代码为 -11)。代码相当复杂,所以很难给出一个最小的例子。问题的要点是我正在做以下事情gensim

  1. 从一些文本构建字典。
  2. 从所述文本和字典构建语料库(需要 (1))。
  3. 从语料库和字典中训练 LDA 模型(需要 (1) 和 (2))。

出于某种原因,每次我放置多个工人时,步骤 (3) 都会崩溃,即使 (1) 和 (2) 已经完成......

任何帮助将不胜感激!

编辑:这是日志信息的示例。TrainLDA 是任务 (3)。之后还有两个任务需要 TrainLDA。所有早期的任务都正确完成。我替换了 TrainLDA 的参数,...以便输出更具可读性。附加信息只是print我们用来帮助​​我们了解正在发生的事情的陈述。

开发银行

0 投票
1 回答
8540 浏览

python - Luigi 管道从 S3 开始

我的初始文件位于AWS S3. 有人可以指出我需要如何设置它Luigi Task吗?

我查看了文档并发现luigi.S3但我不清楚该怎么做,然后我在网上搜索,只从mortar-luigiluigi 获取链接和实现。

更新

在遵循为@matagus 提供的示例之后(我~/.boto也按照建议创建了文件):

当我执行它时,什么也没有发生

如您所见,该消息Doing something...永远不会打印。怎么了?

0 投票
1 回答
1071 浏览

python - 如何避免在 Luigi 中与多个工作人员同时运行特定任务

我使用 Luigi 构建数据分析任务,包括通过 matplotlib 绘图。

似乎 matplotlib 绘图的并发运行会导致问题,这会导致由于某种原因过早地从任务中返回,什么也不做。(看起来这是 matplotlib 的问题,虽然我可能错了。)

为了解决这个问题,我想避免同时为那个绘图任务运行多个工作人员,同时在多个工作人员中运行其他任务。我怎样才能做到这一点?

0 投票
3 回答
799 浏览

python - 使用 luigi 到本地的 S3 文件引发 UnicodeDecodeError

我正在pdf使用以下代码将文件复制到本地:

这是基于这个问题(种类)

但是当我执行该代码时,我得到以下信息:

我尝试了另一种方法,但效果不佳:

正确的做法是什么?

0 投票
0 回答
1070 浏览

python - 无法导入已安装的 Python 模块(用于 Luigi 任务)

我已经查看了关于 SO 的所有论坛关于此类错误的信息,我似乎无法解决我的问题。

我正在尝试导入us模块,但在运行 Luigi 任务时我一直收到相同的导入错误:ImportError: No module named us

我试图强制安装它pip install us —ignore-installed以及卸载它并重新安装它。

下面是输出pip show us

有什么想法吗?