33 lines
1.5 KiB
Python
33 lines
1.5 KiB
Python
import pandas as pd
|
|
import sys
|
|
sys.path.append('Backend')
|
|
from app.config.database import SessionLocal
|
|
from app.services.import_service import import_data
|
|
|
|
df = pd.read_csv('Data_Tracerstudy/Data_2025_Tracer_study_D3MIF.csv', sep=';', encoding='utf-8-sig')
|
|
print("Total rows:", len(df))
|
|
print("\nRow 29 (index 29):")
|
|
print(df.iloc[29][:10])
|
|
|
|
print("\nRow 30 (index 30):")
|
|
print(df.iloc[30][:10])
|
|
|
|
print("\nRow 31 (index 31):")
|
|
print(df.iloc[31][:10])
|
|
|
|
# Let's see what happens if we simulate rows 28 to 35 with import logic
|
|
from app.parsers.mappings import YEAR_CONFIG, IDENTITAS_MAPPING, PEKERJAAN_MAPPING, STUDI_LANJUT_MAPPING, KESESUAIAN_MAPPING, KOMPETENSI_LULUS_MAPPING, KOMPETENSI_SAAT_INI_MAPPING, METODE_PEMBELAJARAN_MAPPING, WAKTU_CARI_KERJA_MAPPING, CARA_CARI_KERJA_MAPPING, LAMARAN_KEAKTIFAN_MAPPING, KESESUAIAN_PEKERJAAN_MAPPING, NUMERIC_FIELDS, get_field_code
|
|
from app.parsers.column_finder import find_column, get_value
|
|
from app.parsers.converters import parse_2024_value, parse_date, konversi_jawaban
|
|
|
|
source_cols = list(df.columns)
|
|
for i in range(28, 35):
|
|
row = df.iloc[i]
|
|
nim = get_value(row, source_cols, IDENTITAS_MAPPING['nim'], '')
|
|
nama = get_value(row, source_cols, IDENTITAS_MAPPING['nama'], '')
|
|
print(f"\nIndex {i}: NIM={repr(nim)}, Nama={repr(nama)}")
|
|
# Check tanggal_masuk_studi
|
|
tgl = get_value(row, source_cols, STUDI_LANJUT_MAPPING['tanggal_masuk_studi'])
|
|
if tgl:
|
|
print(f" tgl raw: {repr(tgl)} -> parsed: {repr(parse_date(tgl))}")
|