apache / apache/datafusion

Move `tempfile` crate to dev dependencies in datafusion core crate

Offen
#17,522 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Rust
Sterne
9.3k
Forks
2.4k
Ø Merge
3 T. 11 Std.
Gemergte PRs (30 T.)
362

Beschreibung

### Is your feature request related to a problem or challenge?

`tempfile` crate is currently included as a normal dependency in the `datafusion` crate. It would be possible to move the dependency to the `dev-dependencies` since the `tempfile` capabilities are only used by integration and unit tests.

Specifically, the following function:

```
/// Generate CSV partitions within the supplied directory
pub fn populate_csv_partitions(
tmp_dir: &TempDir,
partition_count: usize,
file_extension: &str,
) -> Result {
...
```
It is the only one that uses `tempfile` capabilities.

### Describe the solution you'd like

It would be possible to move the `tempfile` crate from `dependencies` to `dev-dependencies` by decorating the `populate_csv_partitions` with the `#[cfg(test)]` attribute and replicating the function where needed in the integration tests (i.e.: `datafusion/core/tests/dataframe/mod.rs`)

### Describe alternatives you've considered

_No response_

### Additional context

I'm opening this as a feature request since it's not an actual bug.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Lokalisieren Sie die Abhängigkeitsdeklarationen des datafusion core crate und alle Verwendungen von populate_csv_partitions. Untersuchen Sie anschließend datafusion/core/tests/dataframe/mod.rs auf den Helper für Integrationstests. Bestätigen Sie, dass tempfile nur von Tests benötigt wird, verschieben Sie es in den Testsatz der Abhängigkeiten und stellen Sie sicher, dass die Unit- und Integrationstests weiterhin kompiliert werden und erfolgreich durchlaufen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
build-system, testing
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.